Page 1 of 1
serendipity_event_s9ymarkup adds </u> to URLs breaking
Posted: Fri Apr 11, 2008 1:33 am
Code: Select all
$text = preg_replace('/\b_([\S ]+?)_\b/','<u>\1</u>',$text);
does not honor URLs that may not be <u>'ified as
that will end up
as to be seen in
http://daniel-lange.com/archives/9-Wiki ... tions.html
(check the Statler and Waldorf link)
Re: serendipity_event_s9ymarkup adds </u> to URLs brea
Posted: Fri Apr 11, 2008 10:31 am
Yes, the s9ymarkup plugin is pretty basic, it can easily screwp up text like this. In those cases you will need to disable s9ymarkup for entries which contain such text. Fixing this would hugely increase the complexity of this small plugin and defeat it's purpose for quick+simple markup.
Yeah, I also don't like what I write about this
Posted: Fri Apr 11, 2008 10:43 am
how about making the regex require (whitespace followed by understore) for <u> and (underscore followed by whitespace) for </u>? There are no whitespaces in URLs and this will not add any complexity.
All the best,
(missing blank added in edit)
Posted: Fri Apr 11, 2008 11:48 am
But that would break formatting like:
Currently the regexp cannot differentiate between a URL and usual plaintext; and it would be pretty hard to detect what's a URL and what not without recursive/implicit regular expressions with backreferences...
Posted: Fri Apr 11, 2008 12:06 pm
That's about priorities. I always prefer not breaking stuff over functionality, but it's obviously your choice to make. I can always patch my local copy (which I'll do, as it breaks my article).
Posted: Fri Apr 11, 2008 12:14 pm
my local version is fixed, thus the link mentioned in post #1 will not show the example in live action anymore.
But you can try the effect of serendipity_event_s9ymarkup breaking URLs with underscores in them out with your local serendipity blog.