Welcome! » Log In » Create A New Profile

Spaces neighboring image tags being eaten

Posted by Rich1 
Rich1
Spaces neighboring image tags being eaten
May 24, 2012 12:59AM

I have the following config:

$config->set('Core.Encoding', 'UTF-8');
$config->set('HTML.Doctype', 'HTML 4.01 Transitional');
$config->set('Cache.SerializerPath', "$ABSOLUTE_PATH/../offline/htmlpurifier");

$config->set('Filter.ExtractStyleBlocks.TidyImpl', false);
$config->set('Filter.ExtractStyleBlocks.Escaping', false);
$config->set('Filter.ExtractStyleBlocks', true);

$config->set('CSS.AllowImportant', true);
$config->set('CSS.AllowTricky', true);
$config->set('CSS.Trusted', true);

$config->set('Attr.EnableID', true);

$config->set('HTML.Trusted', true);

In the following input HTML, the spaces before or after an image tag are being eaten by something and I can't figure out what.

Input:

<img src="http://www.teamliquid.net/images/flags2/fi.png" width="18" height="12" alt="fi"> <img src="http://www.teamliquid.net/mirror/smilies/protoss-small.gif" border="0" alt=""> <b>elfi</b>

Output:

<img src="http://www.teamliquid.net/images/flags2/fi.png" width="18" height="12" alt="fi"><img src="http://www.teamliquid.net/mirror/smilies/protoss-small.gif" border="0" alt=""><b>elfi</b>

Any idea what setting is responsible for this? Thanks.

Re: Spaces neighboring image tags being eaten
May 24, 2012 01:00PM

Try setting %Core.LexerImpl to DirectLex.

Thanks, this seems to have fixed it. Are there any negative side effects or other things to watch out for when using this lexer mode?

Re: Spaces neighboring image tags being eaten
May 25, 2012 11:51PM

It is nominally slower, but it is more precise.

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with &lt; and &gt;.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: