Closed dkharrat closed 11 years ago
Thanks! I'll check this out soon.
On Tue, Apr 2, 2013 at 3:16 AM, Dia Kharrat notifications@github.comwrote:
I was trying your gem to parse bbcode and noticed that it crashed on certain user input. I stripped it down to:
[quote]this is [size]large text[/quote][/size]
This is what I get:
text => "[quote]this is [size]large[/quote][/size]" RbbCode.new.convert(text) NameError: undefined local variable or method
elements' for nil:NilClass from /Users/dia/.rvm/gems/ruby-1.9.3-p125@devmaster/gems/rbbcode-1.0.2/lib/rbbcode/node_extensions.rb:32:in
to_html' from /Users/dia/.rvm/gems/ruby-1.9.3-p125@devmaster/gems/rbbcode-1.0.2/lib/rbbcode.rb:37:inconvert' from (irb):94 from /Users/dia/.rvm/gems/ruby-1.9.3-p125@devmaster/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in
start' from /Users/dia/.rvm/gems/ruby-1.9.3-p125@devmaster/gems/railties-3.2.11/lib/rails/commands/console.rb:8:instart' from /Users/dia/.rvm/gems/ruby-1.9.3-p125@devmaster/gems/railties-3.2.11/lib/rails/commands.rb:41:in
<top (required)>' from script/rails:6:inrequire' from script/rails:6:in
' What's interesting is that for supported tags, it seems to work:
[quote]this is [b]large[/quote][/b]
text = "[quote]this is [b]large[/quote][/b]" => "[quote]this is [b]large[/quote][/b]" RbbCode.new.convert(text) => "\n
[quote]this is large[/quote]
"I would expect the first input to work similarly. Although, the syntax is incorrect, at least it shouldn't crash. The output of the second example is a reasonable one.
— Reply to this email directly or view it on GitHubhttps://github.com/jarrett/rbbcode/issues/17 .
Sorry this took so long. I've pushed a fix to the master branch. I want to release version 1.0.3 with this fix, but for whatever reason, pushing to rubygems.org is failing right now. I'll keep trying to release the new version. In the meantime, you can manually install 1.0.3 with the following steps:
cd
to the project rootrake build
rake install
Awesome, thanks for fixing it!
Ok, I was finally able to release 1.0.3 on Rubygems.
I was trying your gem to parse bbcode and noticed that it crashed on certain user input. I stripped it down to:
This is what I get:
What's interesting is that for supported tags, it seems to work:
I would expect the first input to work similarly. Although, the syntax is incorrect, at least it shouldn't crash. The output of the second example is a reasonable one.