in reply to space before and after

Did you mean to keep the space before the <span> tag?

HTML collapses multiple spaces into one, so what's the point? It'll only serve to introduce errors.

Replies are listed 'Best First'.
Re^2: space before and after
by Anonymous Monk on Sep 03, 2009 at 04:58 UTC
    Remove the spaces in front of tags and after the tags.

      So the output is wrong, then.

      s/\s+(?=<)//g; s/(?<=>)\s+//g;
      • Assumes no unescaped "<" and ">" in flow or other content.
      • Assumes no "<" and ">" in attribute values, comments or in CDATA sections.
      • Assumes no NET tags (a poorly supported SGML construct).
      • Disregards the fact that this changes the HTML to something that's not equivalent.
        Please tell me how to remove the space in "<br/>" ahead and behind the text
        __DATA__ Hi &lt;br/&gt; r u