bhollis / maruku

A pure-Ruby Markdown-superset interpreter (Official Repo).
MIT License
500 stars 80 forks source link

'# {hi}' breaks #20

Closed rylwin closed 11 years ago

rylwin commented 14 years ago

This command is breaking due to nil object in create toc: Maruku.new("# {hi}"). I get the same error when I escape the {}'s: Maruku.new("# {hi}").

I don't really know enough about what's going on under the hood to be any help resolving this issue. Maybe if I get some time I'll dig in. Hope this is helpful.

StackTrace:

Maruku.new("# {hi}") NoMethodError: You have a nil object when you didn't expect it! The error occurred while evaluating nil.section_level from /Library/Ruby/Gems/1.8/gems/maruku-0.6.0/lib/maruku/toc.rb:153:in create_toc' from /Library/Ruby/Gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:64:inparse_doc' from /Library/Ruby/Gems/1.8/gems/maruku-0.6.0/lib/maruku/maruku.rb:30:in initialize' from (irb):26:innew' from (irb):26

bhollis commented 11 years ago

I've confirmed that the error no longer happens on the master branch. However, it probably doesn't do what you want - curly braces are Maruku's attribute syntax, so Maruku produces an empty header. I've added a pending test to fix that.