Is :hard_break working in RedCloth 3.0.4?
$ ruby -v
ruby 1.8.4 (2005-12-24) [i686-linux]
$ pwd
/lib/ruby/gems/1.8/gems/RedCloth-3.0.4/lib
$ irb
irb(main):001:0> require ''redcloth''
=> true
irb(main):002:0> rc = RedCloth.new("h1. Heading\n\n_Not_
heading.")
=> "h1. Heading\n\n_Not_ heading."
irb(main):003:0> rc.to_html(:textile)
=>
"<h1>Heading</h1>\n\n\n\t<p><em>Not</em>
heading.</p>"
All good so far. But now:
irb(main):004:0> rc.hard_breaks = true
=> true
irb(main):005:0> rc.to_html(:textile)
=> "<h1>Heading<br />\n<em>Not</em>
heading.</h1>"
Ooops - that''s definitely not right. I originally thought there was
some
kind of interaction with Rails 1.1.4, because my Instiki installation
went nuts when a sysadmin upgraded from Rails 1.1.0 to 1.1.4. But surely
RedCloth has no dependencies upon Rails, so it is presumably a concurrent
upgrade of the RedCloth gem (from what is, I''m afraid, an unknown
earlier
version) that has introduced the problem.
BTW, filter_html might be broken too - this doesn''t look like what
I''d
expect it to do at all:
irb(main):002:0> rc = RedCloth.new("Escape<br>This
<stuff>.")
=> "Escape<br>This <stuff>."
irb(main):003:0> rc.to_html(:textile)
=> "<p>Escape<br>This <stuff>.</p>"
irb(main):004:0> rc.filter_html = true
=> true
irb(main):005:0> rc.to_html(:textile)
=> "<p>Escape<br>This .</p>"
--
TTFN, Andrew Hodgkinson
Find some electronic music at: All sorts of other bits and pieces at:
http://www.ampcast.com/pond http://pond.org.uk/