Sunday, 15 January 2012

php - HTML Purifier preserve spaces -



php - HTML Purifier preserve spaces -

is there anyway create html purifier preserve implict spaces typically seen in rendered html?

for illustration typically expect space between foo , bar in these next cases:

foo<br/>bar

example 1

<div>foo</div><div>bar</div>

example 2

looks htmlpurifier not removing whitespace, it's removing tags because doesn't recognize them (which weird).

in regards foo<br/>bar

error line 1, column 3: unrecognized <br /> tag removed

in regards <div>foo</div><div>bar</div>

error line 1, column 0: unrecognized <div> tag removed error line 1, column 8: unrecognized </div> tag removed error line 1, column 14: unrecognized <div> tag removed error line 1, column 22: unrecognized </div> tag removed

you can see enabling collecterrors on live demo.

maybe seek allowing div, , br: http://htmlpurifier.org/live/configdoc/plain.html#html.allowedelements

here results live demo:

php htmlpurifier

No comments:

Post a Comment