
Can't turn "next. " into html
Reported by Edward Waller | November 27th, 2008 @ 11:52 PM | in 4.1.9
When trying to convert a comment on my site into html, using the to_html method, RedCloth seems to have choked on the input. I narrowed the problem down to the following example.
>> require 'redcloth'
=> true
>> RedCloth::VERSION
=> 4.1.1
>> RedCloth.new("next. ").to_html
ArgumentError: wrong number of arguments (1 for 0)
from /Library/Ruby/Gems/1.8/gems/RedCloth-4.1.1/lib/redcloth/textile_doc.rb:83:in `next'
from /Library/Ruby/Gems/1.8/gems/RedCloth-4.1.1/lib/redcloth/textile_doc.rb:83:in `to'
from /Library/Ruby/Gems/1.8/gems/RedCloth-4.1.1/lib/redcloth/textile_doc.rb:83:in `to_html'
from (irb):2
>> RedCloth.new("next.").to_html
=> "<p>next.</p>"
>> RedCloth.new("next..").to_html
=> "<p>next..</p>"
>> RedCloth.new("next.. ").to_html
ArgumentError: wrong number of arguments (1 for 0)
from /Library/Ruby/Gems/1.8/gems/RedCloth-4.1.1/lib/redcloth/textile_doc.rb:83:in `next'
from /Library/Ruby/Gems/1.8/gems/RedCloth-4.1.1/lib/redcloth/textile_doc.rb:83:in `to'
from /Library/Ruby/Gems/1.8/gems/RedCloth-4.1.1/lib/redcloth/textile_doc.rb:83:in `to_html'
from (irb):5
Comments and changes to this ticket
-
Michele January 8th, 2009 @ 10:44 AM
The problem seems to be if the text before the dot is a valid method of String, it gets called and is passed an argument.
You can try any of the following: "split. ", "downcase. ", "min. " and so on.
-
Jason Garber January 21st, 2009 @ 01:12 PM
- State changed from new to open
Yeah, that's a big problem. I'll fix it.
-
Jason Garber January 21st, 2009 @ 04:31 PM
- State changed from open to resolved
(from [a5d76667500de4c43499904cabb7b56b1cba6fb4]) Fixed custom block signatures calling built-in Ruby String methods. [#92 state:resolved] http://github.com/jgarber/redclo...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
RedCloth is a Ruby library for converting Textile into HTML
People watching this ticket
Referenced by
-
99 Acronyms at the beginning of a line This is a duplicate of #92, so closing. Thanks for the re...
-
92 Can't turn "next. " into html (from [a5d76667500de4c43499904cabb7b56b1cba6fb4]) Fixed c...