Recently on my website, I ran into a problem, rather confusing at the first sight: Stand-alone Smiley was never replaced if inserted at the end of text, even if there was white-space after. It took me a while to realize, that the "white-space" after smiley was in fact a hard-space (or at least we call it this way in my country - I mean the good old hex. code A0, now in UTF-8 encoded as C2 A0). This character, in my case created by another text-filtering module (Texy!; but might be easily inserted in other ways too) is very confusing, as it looks like an ordinary white-space. In fact it IS ordinary white-space, just disallowing line-breaking.

So, I need Smileys to recognize this kind of white-space, if surrounding a stand-alone smiley. Also more brackets would be nice. I created a patch, which is just a little change to the regexp used.

For normal (not stand-alone) smileys there's no need to use regexp at all, a simple str_replace() will do just fine. Since this is faster and recommended, I included this change too.

Patch attached.

CommentFileSizeAuthor
smileys-hard-space.patch1.22 KBJirkaRybka

Comments

HellMind’s picture

My problem with Stand-alone is I cant disable it ( it always works like it were active all the time)

to replace the acronym (3-Spade) it must be between spaces (3-Spades)(3-Spades) ins't work and like this (3-Spades) (3-Spades)it works :(

This patch will fix that?

Gurpartap Singh’s picture

HellMind, I guess that was another issue, which is fixed in development release right now. Please let me know if there's any such issue again.

Gurpartap Singh’s picture

Status: Needs review » Closed (fixed)

I don't find this issue to be problematic for most of the websites. However, if this really pinches, feel free to reopen the issue.

JirkaRybka’s picture