Te beginning of a paragraph starts ofthen with a
(unwanted) space. This is a space after the <P>, <td>
I used the following work around to delete this space in
the HTML, before it get parsed. This removes the space
in the beginning of the paragraph.
//Match every tag except "text" tags with white space
$regexp = '#(<\s*(?!(b|strong|i|em|u|span|font)\b)[^/][^>]
//Remove the whitespace
$html = preg_replace($regexp, '\\1', $html);
Any comments, improvements etc. are welcome.
Log in to post a comment.