2 bugs when parsing emphasized or bold text
Bas Kloet
bas at luon.net
Sun Jul 2 06:13:43 EDT 2006
I've found 2 bugs that produce (imho) incorrect rendering results:
1) The regexp for strong (*) and bold (**) is greedy, which produces
very strange results.
The simplest way to show the problem is to give an example.
This is the original code:
=====
Strong:
Lets do a little test *t*
this should not be strong *u*.
Bold:
Lets do another test **t**
this should not be bold **u**.
=====
And this is the (relevant part of) the html that is produced:
=====
<p>Strong:
Lets do a little test <strong>t*
this should not be strong *u</strong>.</p>
<p>Bold:
Lets do another test <b>t<strong>*
this should not be bold *</strong>u</b>.</p>
=====
As you can see, the html produced is not exactly what you would expect.
2) Using _TEXT_ to emphasize a string doesn't work if TEXT spans
multiple lines.
If you want to emphasize a piece of text that spans multiple lines, then
_TEXT_ does not work, the underscores are simply shown in the generated
text, even if there are no hard linebreaks.
I filed these bugs both with the Debian bugtracker and the tracker on
rubyforge a couple of weeks ago, but there was no response. Though I'm a
pretty decent ruby coder, the redcloth code is way over my head, so I
was wondering if anyone here has a solution to one or both of the above
problems?
Thanks,
Bas
More information about the Redcloth-upwards
mailing list