Forum: Redcloth Recent bug in RedCloth 4.1.9

1a1551a3a11e750cd46e5699cb175941?d=identicon&s=25 Rodrigo Rosenfeld Rosas (Guest)
on 2009-04-08 16:20
(Received via mailing list)
Could someone confirm this bug?

RedCloth.new("!/image_r.jpg(description)!:image.jpg").to_html

<p><a href="image.jpg"><img src="/image_r.jpg" title="description"
alt="description" /></a></p>

That is correct.

Then we just add an "a" (or anything else) to the end of the string:

RedCloth.new("!/image_r.jpg(description)!:image.jpg a").to_html

Incorrect result (link is missed):
<p><img src="/image_r.jpg" title="description" alt="description" />
a</p>

It only happens when "(description)" is present.
Maybe RedCloth should include this case on test suite.


Tested on last stable version (4.1.9).

The problem doesn't exist on 4.1.1.

P.S: a curiosity: why 4.1.9 follows 4.1.1, instead of 4.1.2?


      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
A50dcaaf8e545e6cc1fb4e32919be6ad?d=identicon&s=25 Jason Garber (jgarber)
on 2009-04-08 18:17
(Received via mailing list)
Rodrigo, thanks for reporting the bug.  I've made a ticket for it at
http://jgarber.lighthouseapp.com/projects/13054-re...
   If you want to follow the status, sign in to Lighthouse.

BTW, 4.1.9 followed 4.1.1 because I was trying to be cute.  RedCloth
4.1.9 was the first release to be compatible with Ruby 1.9.  Get it?
In the end, though, it was a mistake.  I've wanted to release another
4.1.x but I don't want to do 4.1.10 because then you can't compare
version numbers as strings. Not to mention the fact that it's just
plain confusing  So, expect the next version to be 4.2.0.
457cf540784a12ba2f30e06565a2c189?d=identicon&s=25 Hugh Sasse (Guest)
on 2009-04-09 15:34
(Received via mailing list)
On Wed, 8 Apr 2009, Jason Garber wrote:

> BTW, 4.1.9 followed 4.1.1 because I was trying to be cute.  RedCloth 4.1.9 was
> the first release to be compatible with Ruby 1.9.  Get it?  In the end,
> though, it was a mistake.  I've wanted to release another 4.1.x but I don't
> want to do 4.1.10 because then you can't compare version numbers as strings.

Are we going to be stuck with this idea forever?  We ran into this
when the successor to Ruby 1.8 could not be Ruby 1.10, breaking the
odd/even as unstable/stable releases pattern.  Version numbers are
not strings, but even if they are (a) they should be parsed (Is
Debian version "Woody".to_i.zero? ?), and (b):

http://rubyforge.org/projects/natcmp/

Try searching for "natural order string comparison".

I really think that Ruby needs a native class for versions.
That way it would not be a subclass of String.
I should have used Comparable for this, written about 7 months into
using Ruby:

http://www.cse.dmu.ac.uk/~hgs/ruby/revision.rb

My point being this is not something doable by only the advanced
programmer, even if this effort could do with improvement.

The other reason Ruby didn't have 1.10 as a stable release was C code
checking based on single bytes per {major, minor, teeny} (or whatever
you call the third one).

Do you have any evidence for people comparing these (Redcloth)
version numbers as if they were strings?  If nobody does, then why
worry about it?  The clue is in the nomenclature: "version *numbers*".

> Not to mention the fact that it's just plain confusing  So, expect the next

I don't see that as confusing: it's one of those things that is already
tradition in this field less than 100 years old.

> version to be 4.2.0.
>

        Hugh
A50dcaaf8e545e6cc1fb4e32919be6ad?d=identicon&s=25 Jason Garber (jgarber)
on 2009-04-10 14:38
(Received via mailing list)
Thanks for the feedback.  I picked up on the whole comparing version
numbers as strings from here: http://www.ruby-forum.com/topic/179119
Right or wrong, being able to compare Ruby version numbers as strings
was enormously helpful in that circumstance.  I wish they would build
version comparison directly into Ruby too!

I have no evidence that people are comparing RedCloth version numbers
as strings—and they probably aren't—so it's probably no big deal if I
would make a 4.1.10.  There was a 2.0.10 before, so there you go.

Not that I have time right now to do anything that would deserve a new
version. :-(  Wish I did because I really enjoy hacking on RedCloth!

Jason
1a1551a3a11e750cd46e5699cb175941?d=identicon&s=25 Rodrigo Rosenfeld Rosas (Guest)
on 2009-04-10 17:11
(Received via mailing list)
Jason Garber escreveu:
> ...
> Not that I have time right now to do anything that would deserve a new
> version. :-(  Wish I did because I really enjoy hacking on RedCloth!
You could find out what broke RedCloth, regarding this bug, for instance
;) I don't know what version control system you are using but, on git,
there is the "git blame" that could give you a hint of what broke
RedCloth in 4.1.9 that was not present in 4.1.1. Fixing this but on
4.1.10 would be enough for a new version :)

Best Regards,

Rodrigo.






_______________________________________________________
Yahoo! Mail - Sempre a melhor opção para você!
Experimente já e veja as novidades.
http://br.yahoo.com/mailbeta/tudonovo/
This topic is locked and can not be replied to.