Ruby Forum Redcloth > Line break bug?

Posted by Thomas Watson Steen (Guest)
on 11.04.2008 12:45
(Received via mailing list)
As far as I can read on blogs around the internet, this "bug" is not
new:

foo
bar

is translated to: "<p>foo bar</p>" and not "<p>foo<br />bar</p>".

After searching the web for an answer it seems that the missing line-
break functionality is there on purpose.

What is the reason for this?
... and is there a way to "fix" it?

/watson
Posted by Gaspard Bucher (gazoduc)
on 11.04.2008 14:29
(Received via mailing list)
I totally agree. I fixed it in my own projects by doing a gsub on the
final result.

For me (and all my clients), it's clear that when they write

my name
45, funny stree
12345 MyPlace

They *want* the breaks.

The absence of the <br/> is an "inverse" fix. Some form entries used
to automatically wrap lines by adding "\n" (as in most web emails).
The inverse fix made text entries tolerant to this "bug".

Normal behaviour should definitely be to insert the <br/> tag. When
some input comes malformed, it should be unwrapped before parsing.
This would really make sense.

So, please add the <br/>.

Gaspard
Posted by David Reese (Guest)
on 11.04.2008 17:31
(Received via mailing list)
> foo
> bar
>
> is translated to: "<p>foo bar</p>" and not "<p>foo<br />bar</p>".

some more history:  this was brought up last year in the comments on the
ol' redhanded
(http://redhanded.hobix.com/inspect/superredcloth1160Gems.html), where
someone named fat (responded to by someone named _why, eventually this
all starts to make sense) makes the common-sense argument that redcloth
shouldn't ignore return marks if people put them in, and people seem to
agree.

this used to be a setting, :hard_breaks, which was taken out sometime, i
forget if i ever read why.  jason? it doesn't seem like it's a question
of being hard to implement. two breaks => <p>, one break => <br />, 
right?

d
Posted by Jason Garber (Guest)
on 11.04.2008 20:15
(Received via mailing list)
RedCloth 4.0 (a.k.a. SuperRedCloth) atones for the transgressions of
its predecessor and honors hard breaks.  We hope to release it soon.
Please help test...

   gem install RedCloth --source http://code.whytheluckystiff.net
Posted by Thomas Watson Steen (Guest)
on 12.04.2008 01:50
(Received via mailing list)
On 11/04/2008, at 20.14, Jason Garber wrote:
> RedCloth 4.0 (a.k.a. SuperRedCloth) atones for the transgressions  
> of its predecessor and honors hard breaks.  We hope to release it  
> soon.  Please help test...
>
>   gem install RedCloth --source http://code.whytheluckystiff.net

Thanks :)  - It worked like a charm. Now line-breaks are interpreted
as expected. I'll keep using this version and of cause report any
bugs I might find.

/watson
Posted by Thomas Watson Steen (Guest)
on 12.04.2008 11:37
(Received via mailing list)
On 12/04/2008, at 1.26, Thomas Watson Steen wrote:
> Thanks :)  - It worked like a charm. Now line-breaks are  
> interpreted as expected. I'll keep using this version and of cause  
> report any bugs I might find.

Well, it worked on my MacBook Pro running OS X 10.4
But on my staging and production server both running FreeBSD 6.2 I
get the following error:
>
> redcloth_scan.
>
> Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/ 
> gems/RedCloth-3.290 for inspection.
> Results logged to /usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.290/ 
> ext/redcloth_scan/gem_make.out


I don't know exactly what happends when I install a gem, but it seems
that some C code is compiled for the specific platform. I don't know
if this bug is related to RedCloth at all, but I've been unsuccessful
finding anybody on the web having the same problem. So I hope you
might give me some pointers...

/watson