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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1936 bytes Desc: not available Url : http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080411/a33e31ed/attachment.bin
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 On Fri, Apr 11, 2008 at 12:23 PM, Thomas Watson Steen <twa at 3dbyggeri.dk> wrote:> 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 > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards >
> 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> > 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 > ------------------------------------------------------------------------ > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080411/717040af/attachment.html
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 On Apr 11, 2008, at 6:23 AM, Thomas Watson Steen wrote:> 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_______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards
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.netThanks :) - 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1936 bytes Desc: not available Url : http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080412/447cf0fd/attachment.bin
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:> [root at web01 ~]# gem install RedCloth --source http:// > code.whytheluckystiff.net > Building native extensions. This could take a while... > ERROR: Error installing RedCloth: > ERROR: Failed to build gem native extension. > > /usr/local/bin/ruby18 extconf.rb install RedCloth --source http:// > code.whytheluckystiff.net > checking for main() in -lc... yes > creating Makefile > > make > cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd6 -I. -fPIC -O2 - > fno-strict-aliasing -pipe -fPIC -O0 -c redcloth_inline.c > cc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd6 -I. -fPIC -O2 - > fno-strict-aliasing -pipe -fPIC -O0 -c redcloth_scan.c > > cc1: out of memory allocating 637512112 bytes > *** Error code 1 > > Stop in /usr/local/lib/ruby/gems/1.8/gems/RedCloth-3.290/ext/ > 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.outI 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1936 bytes Desc: not available Url : http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080412/59737de3/attachment.bin
To flip this bug discussion on its head. I can understand the desire to conform to the Textile standard, but I actually find the (old) red cloth''s behaviour far more useful in 99% of cases. I very rarely type out addresses, or anything which leads me to care about the exact positioning of my end of lines, except for code samples, already handled by bc. On the other hand, what I do end up doing a lot is storing pages written in textile in VCS systems, so that they can be worked on easily by collaborators, or just to track them over time. And for this purpose, being able to type my paragraphs in 80 or 90 character lines, but have them display as a normal HTML paragraph is far more valuable. Merges become easier and diffs (Did they add a comma or a sentence?) are much more comprehensible. It far out outweighs the inconvenience of having to type <br /> a few times for an address. Would it be possible to add an option to disable the over enthusiastic line-breaking? -- Posted via http://www.ruby-forum.com/.
There is an option. just set the hard_breaks accessor of your RedCloth object to false. On Aug 2, 2008, at 6:58 AM, Jonathan Stott wrote:> To flip this bug discussion on its head. > > I can understand the desire to conform to the Textile standard, but I > actually find the (old) red cloth''s behaviour far more useful in 99% > of > cases. > > I very rarely type out addresses, or anything which leads me to care > about the exact positioning of my end of lines, except for code > samples, > already handled by bc. On the other hand, what I do end up doing a > lot > is storing pages written in textile in VCS systems, so that they can > be > worked on easily by collaborators, or just to track them over time. > And > for this purpose, being able to type my paragraphs in 80 or 90 > character > lines, but have them display as a normal HTML paragraph is far more > valuable. Merges become easier and diffs (Did they add a comma or a > sentence?) are much more comprehensible. It far out outweighs the > inconvenience of having to type <br /> a few times for an address. > > Would it be possible to add an option to disable the over enthusiastic > line-breaking? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards