More "blank" characters to recognize around smileys

JirkaRybka - July 16, 2007 - 20:34
Project:Smileys
Version:5.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

AttachmentSize
smileys-hard-space.patch1.22 KB

#1

HellMind - January 11, 2008 - 21:03

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?

#2

Gurpartap Singh - January 25, 2008 - 02:15

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.

#3

Gurpartap Singh - June 7, 2008 - 18:07
Status:needs review» closed

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.

#4

JirkaRybka - September 11, 2009 - 23:47
 
 

Drupal is a registered trademark of Dries Buytaert.