Emoticons in comments

Found a bug? Tell us!!
Post Reply
Rexxer
Regular
Posts: 62
Joined: Sat Oct 22, 2005 11:10 am

Emoticons in comments

Post by Rexxer »

I don't really know, whether it's a bug or whether it's supposed to be that way, but an emoticon that's entered right at the beginning of a comment is not being replaced by its' icon. I stumbled upon this after I added an emoticons.inc.php and wanted to test that. I have seen this behavior with 1.0-beta2 and a relatively current 1.1-build.

I hope someone can shed some light on this issue.

TIA,
Andre
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Yes, to prevent making emoticons out of stuff that's really supposed to be symbols or text, we only convert the emoticon text if it's got a tab, space, period, exclamation point, or greater-than; AND if it ends with the same stuff (but less-than instead of greater-than) or end-of-line.

Phew.

If you want it to work at the very beginning, too, go to serendipity_event_emoticate.php, around line 175, and replace this:

Code: Select all

$element = preg_replace("/([\t\s\.\!>]+)" . $key . "([\t\s\!\.\)<]+|\$)/U",
with this:

Code: Select all

$element = preg_replace("/([\t\s\.\!>]+|^)" . $key . "([\t\s\!\.\)<]+|\$)/U",
Let me know how it works out.
Judebert
---
Website | Wishlist | PayPal
Rexxer
Regular
Posts: 62
Joined: Sat Oct 22, 2005 11:10 am

Post by Rexxer »

judebert wrote:Yes, to prevent making emoticons out of stuff that's really supposed to be symbols or text, we only convert the emoticon text if it's got a tab, space, period, exclamation point, or greater-than; AND if it ends with the same stuff (but less-than instead of greater-than) or end-of-line.

Phew.
So it's intentional behavior. I'll just tell my readers, and that should do it. Thanks for the explanation :-)

Andre
Post Reply