Page 1 of 1

s9y converts (and destroys) URLs in posted links

Posted: Mon Nov 09, 2009 12:24 pm
by bleeb
Found this problem today:

I wanted to post a link containing underscores:

Code: Select all

<a href="http://www.downstairs.com/_4046___Sonny_Black_%26_Frank_White_-_Carlo_Cokxxx_Nutten_2.html">
Now s9y will convert this to

Code: Select all

<a href="http://www.downstairs.com/<u>4046___Sonny_Black</u>%26_Frank_White_-_Carlo_Cokxxx_Nutten_2.html">
which it shouldn't. Can I disable this behaviour globally (I don't use the _blabla_ and *blabla* markup anyway)? But s9y shouldn't convert data in html-attributes anyway.

Re: s9y converts (and destroys) URLs in posted links

Posted: Mon Nov 09, 2009 12:46 pm
by garvinhicking
Hi!

The "Serendipity Markup" plugin formats "_underscored_" words as underlines. To prevent that, you'll need to disable the serendipity markup event plugin either globally, or on a per-entry basis.

In your case, removing that plugin completely would be preferred choice. :)

Regards,
Garvin

Re: s9y converts (and destroys) URLs in posted links

Posted: Mon Nov 09, 2009 1:04 pm
by bleeb
Great, thanks!

But should "converting data-inside-quotes-inside-tags" still being considered a bug?

s9y does so very arbitrarily. For example it will not "destroy" this link:

http://www.downstairs.com/_k15_Marken.html

If I remove the %26 ("&") AND the minus-character from the first URL it won't be converted. So my guess is that s9y's markup-plugin tries to not convert tag attributes but fails because of those "special" characters.

v1.4.1 btw..

Re: s9y converts (and destroys) URLs in posted links

Posted: Mon Nov 09, 2009 5:44 pm
by garvinhicking
Hi!

Detecting if a string is within a HTML tag attribute, or simply within normal quotes requires HEAVY regular expression lifting. The plugin is aimed for fast translation, so it's not within the scope to check for those edge scenarios sadly.

The current pattern simply says "replace _ with underline, when _ occurs befor and after any word-character". A word character is a-z0-9 plus some minor others; so this rule does not apply if a punctuation indicator like "&" appears; it's not checking for being within attributes whatsover....

Regards,
Garvin