Hard_breaks issues

Hello,

I’m new to this list, so first of all, many thanks to RedCloth’s
developers, it really helps me in many ruby apps :slight_smile:

I post here because I’d like to have a clear view on “hard_breaks”
related issues. I saw old references on the web and on the archives on
this ML, I’d like a fresh view !
It seems that RedCloth 3.0.4 does not handle “\n” as my previous
reference (here : http://textism.com/tools/textile/index.php). Actually,
hobix.com” website (quoted in the redcloth doc) differs on the “

point. So first, can you confirm which is the real reference for the
Textile “language”, and what spec Redcloth follow ?

The latest stable release does everything well for me except “\n” =>

”, it leaves “\n” as is.
I use a very basic code : @blah = RedCloth.new(text_to_parse).to_html
I tried to add the array [:hard_breaks] as a second parameter, but not
only it does not parse \n “well” (see below), but other features
disappear, except bold, underline, links and some other transformations.
Maybe it’s the standard behaviour, but in that case, I think I don’t
really understand the second parameter usage…

When I say “does not parse \n well”, I mean :

  • the sample given on the link above is visually parsed the same way,
    except the “That was a line break” paragraph and some tabulations in
    pre/code sections
  • I tried “test\nblah\nbleh” on both, original textile result is
    “\t

    test
    \nblah
    \nbleh

    ” while RedCloth 3.0.4 result is

    test\nblah\nbleh

Here are the questions :

  • is this behaviour normal (according to developper point of view /
    principles) ?
  • if not, is it corrected on dev version, or about to be (I saw the name
    “SuperRedCloth” ??) ? and how to test it ?
  • would you be interested in a patch that make redcloth 3.0.4 behaviour
    similar to textile php implementation, or it is to be outdated ? I’ve
    one, strongly inspired from the php class by Alex Shiels. I think it
    works well, but I’m a ruby beginner, the code may be ugly… Moreover, it
    appears that it is not affected by bug #36 (seen on
    https://code.whytheluckystiff.net/redcloth/, if it is up to date)

Thank you,

Cheers,


Jean-Baptiste BARTH

This issue will very soon be corrected with the release of RedCloth
4.0 (was the SuperRedCloth branch). We’ve kicked around the idea of
releasing a patched version of 3.x simultaneously, but I’m not
planning to spend any time on it, so I doubt it will happen. I’m
afraid it would just complicate things unnecessarily.

I’m back from my honeymoon, so I hope we can get some final issues
worked out and release 4.0 soon.

Thanks!
Jason

Ok thanks, I understand your position.
Actually I took a look at the upcoming version and it looks like it
resolves
the great majority of the bugs I found in version 3.0.4…
Hope the final version will be released soon :wink:


Jean-Baptiste

2008/5/20 Jason G. [email protected]:

On Tue, May 20, 2008 at 11:16:49AM -0400, Jason G. wrote:

I’m back from my honeymoon, so I hope we can get some final issues worked
out and release 4.0 soon.

Oh, hey, welcome back, Jason. I’m busy with a Shoes release for the
next week, but after that I can concentrate on getting the RedCloth
release all smoothed out with you. It looks like all the tickets
left in Trac were all RedCloth 3?

_why

Not all the tickets in Trac are RedCloth 3. There are some marked
SUPER: http://code.whytheluckystiff.net/redcloth/report/2

I’m stumped on #50, 54 and 55. Could you try to fix them?

Jason