alminium / redmine_redcarpet_formatter

Another Markdown Wiki Formatter for Redmine based on Redcarpet markdown processor.
GNU General Public License v2.0
135 stars 38 forks source link

Section editing is broken in ruby 1.9.3 #8

Closed pdkl95 closed 12 years ago

pdkl95 commented 12 years ago

Section editing crashes with this error (after removing some backtrace silencers that are normally active):

NoMethodError (undefined method `each' for #<String:0x00000006470df0>):
  plugins/redmine_redcarpet_formatter/lib/redmine/wiki_formatting/markdown/formatter.rb:66:in `extract_sections'
  plugins/redmine_redcarpet_formatter/lib/redmine/wiki_formatting/markdown/formatter.rb:42:in `get_section'
  app/controllers/wiki_controller.rb:118:in `edit'

I turns out the fix was easy, though. Ruby 1.8.7's String#each was being used, which does not exist in 1.9.3; you have to use the more specific String#each_line.