I have an html containing   but I am unable to pass it through wp_kses(). I have tried adding allowed html
array(' ' => array(),) but does not seems to work.
I there a way or I should not do that?
not sure the difference but I used
for adding a white space ..then passed it through
The correct HTML entity for a non-breaking space is
— note the
; which is required and without it (i.e.
), the entity is not valid and when used with
wp_kses(), you'd get
&nbsp instead of a non-breaking space.
strangely it was working fine before I used
I'm pretty sure it's because the browser is smart enough and auto-corrected it to
So, always use valid HTML entities and also tags (e.g. close a
<div> with a
</div>), regardless you use
wp_kses() or not. Don't rely on "intelligent guess" or auto correction by the browser.