You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Eliph, thanks for reporting this. If I can fix this easily I will, otherwise I'll look at adding a text smiley->glyph textplug when textplugs are added to the core.
Hi Steve
We have issues with Smilies which have a nose! Textile 2.4.3 seems to do fine, but with 3.5.5 there are some flaws, with: :'( :-) :-| :-O :-( 8-) :-D :-P ;-). The first, fifth, sixt and last do not get parsed and are stricted out. I guess there must be some masquerade happening, which has no return to origin entry.
Please note: If our emoticate plugin is happening first, it breaks all multiple smiley appearances with 3.5.5.
@ophian Ian, I took a quick look at this last night and have a quick fix that you can try. It probably won't be going into the core without further consideration as it alters the behaviour of all spans for cases where the span is preceded by a colon or semi-colon.
On to the fix: just extend class Parser to override spans() with the following and you should find that smileys have a happier time...
Uh fantastic, thanks!
Well, I have to figure out how to include this extend class right, but I can say by now, this inside fix is working well for all noses, ie :- or ;-, but not for the very first smiley.
@ophian You'd need to add something like this to your new class file to get that first nose fixed...
protected function prepGlyphs()
{
parent::prepGlyphs();
array_unshift($this->glyph_search, "/:'([)(])/".$this->regex_snippets['mod']);
array_unshift($this->glyph_replace, ":'\$1");
}
The above is untested but should mean that :') and :'( remain untouched. NB. This change will break textile's single character curly quoting of any bracketed strings ending in a colon - Avoid ('blended frogs:') where possible.
I get preg_replace(): No ending delimiter ':' found in /path/to/lib3/src/Netcarver/Textile/Parser.php on line 3861
and lots of preg_replace_callback(): Compilation failed: invalid UTF-8 string at offset 45 in /path/to/classSmiley.php on line 30
errors.
It looks like encoding stuff is making trouble, but if I change your tweaks in the origin method without SmileyParser, it works.
Do you have any ideas what might be the issue or how to get me on the right track?
Yepp, the ending delimiter is gone, but it still breaks with lots of
preg_replace_callback(): Compilation failed: invalid UTF-8 string at offset 45 in classSmiley.php on line 30
Steve, I am sorry to say it is not in prepGlyphs(), as I tried to say before. It is produced in cloned method spans($text). If I change to $pnct = ".,\"'?!‹›«»„“”‚‘’"; and (?P<tail>$|[\[\]}<]|(?=[$pnct:;]{1,2}[^0-9]|\s|\))) in parent (Parser) class and don't clone this method, it works without errors. This is weird, since it doesn't make any sense to me. But this sadly is my experience. I can't even say where that offset 45 happens in preg_replace_callback.
Steve, I think I got it!
These errors and this clone thing made me crazy and took me to the wild, until I found our emoticate plugin being the cause of all things. It converted to smiley images including an alt tag, holding the human readable, non escaped special emoticate chars. I now made an exception for textile, to just hold the smileys name in there instead and that was it, I hope!
Thanks for your friendly help on this. On my behalf this issue may be set to closed.
@ophian Glad to hear you managed to resolve your issue. I will leave this issue open for now as we still need to be able to handle this easily in forthcoming releases.
Yeah better do so, since I was a little bit too quick. This strange clone error still happens (if not editing the origin spans() method), if the emoticate plugin is parsed after textile made its work.
Activity
netcarver commentedon Dec 31, 2012
Hi Eliph, thanks for reporting this. If I can fix this easily I will, otherwise I'll look at adding a text smiley->glyph textplug when textplugs are added to the core.
Update changelog.
ophian commentedon Jan 2, 2014
@netcarver
Hi Steve
We have issues with Smilies which have a nose! Textile 2.4.3 seems to do fine, but with 3.5.5 there are some flaws, with:
:'( :-) :-| :-O :-( 8-) :-D :-P ;-). The first, fifth, sixt and last do not get parsed and are stricted out. I guess there must be some masquerade happening, which has no return to origin entry.Please note: If our emoticate plugin is happening first, it breaks all multiple smiley appearances with 3.5.5.
netcarver commentedon Jan 3, 2014
@ophian Ian, I took a quick look at this last night and have a quick fix that you can try. It probably won't be going into the core without further consideration as it alters the behaviour of all spans for cases where the span is preceded by a colon or semi-colon.
On to the fix: just extend class
Parserto overridespans()with the following and you should find that smileys have a happier time...ophian commentedon Jan 3, 2014
Uh fantastic, thanks!
Well, I have to figure out how to include this extend class right, but I can say by now, this inside fix is working well for all noses, ie
:-or;-, but not for the very first smiley.netcarver commentedon Jan 3, 2014
@ophian You'd need to add something like this to your new class file to get that first nose fixed...
The above is untested but should mean that
:')and:'(remain untouched. NB. This change will break textile's single character curly quoting of any bracketed strings ending in a colon -Avoid ('blended frogs:') where possible.ophian commentedon Jan 3, 2014
Thank you, Steve!
I get
preg_replace(): No ending delimiter ':' found in /path/to/lib3/src/Netcarver/Textile/Parser.php on line 3861and lots of
preg_replace_callback(): Compilation failed: invalid UTF-8 string at offset 45 in /path/to/classSmiley.php on line 30errors.
It looks like encoding stuff is making trouble, but if I change your tweaks in the origin method without SmileyParser, it works.
Do you have any ideas what might be the issue or how to get me on the right track?
Cheers
netcarver commentedon Jan 3, 2014
@ophian My mistake, I've updated my code example above that should fix your ending delimiter troubles. Care to update and try it again?
ophian commentedon Jan 4, 2014
Yepp, the ending delimiter is gone, but it still breaks with lots of
preg_replace_callback(): Compilation failed: invalid UTF-8 string at offset 45 in classSmiley.php on line 30
netcarver commentedon Jan 4, 2014
@ophian Sorry for the delay in replying. I've updated the post above for a third try.
ophian commentedon Jan 5, 2014
Steve, I am sorry to say it is not in prepGlyphs(), as I tried to say before. It is produced in cloned method spans($text). If I change to
$pnct = ".,\"'?!‹›«»„“”‚‘’";and(?P<tail>$|[\[\]}<]|(?=[$pnct:;]{1,2}[^0-9]|\s|\)))in parent (Parser) class and don't clone this method, it works without errors. This is weird, since it doesn't make any sense to me. But this sadly is my experience. I can't even say where that offset 45 happens in preg_replace_callback.ophian commentedon Jan 5, 2014
Steve, I think I got it!
These errors and this clone thing made me crazy and took me to the wild, until I found our emoticate plugin being the cause of all things. It converted to smiley images including an alt tag, holding the human readable, non escaped special emoticate chars. I now made an exception for textile, to just hold the smileys name in there instead and that was it, I hope!
Thanks for your friendly help on this. On my behalf this issue may be set to closed.
netcarver commentedon Jan 5, 2014
@ophian Glad to hear you managed to resolve your issue. I will leave this issue open for now as we still need to be able to handle this easily in forthcoming releases.
ophian commentedon Jan 6, 2014
Yeah better do so, since I was a little bit too quick. This strange clone error still happens (if not editing the origin spans() method), if the emoticate plugin is parsed after textile made its work.