s9y converts (and destroys) URLs in posted links

Found a bug? Tell us!!
Post Reply
bleeb
Regular
Posts: 7
Joined: Fri Oct 23, 2009 11:57 am

s9y converts (and destroys) URLs in posted links

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bleeb
Regular
Posts: 7
Joined: Fri Oct 23, 2009 11:57 am

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

Post 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..
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply