lib/wikicloth/wiki_buffer.rb in wikicloth-0.8.0 vs lib/wikicloth/wiki_buffer.rb in wikicloth-0.8.1

- old
+ new

@@ -240,11 +240,11 @@ return true end def behavior_switch_key_name(name) keys = [:toc,:notoc,:forcetoc,:noeditsection,:editsection] - locales = [@options[:locale],I18n.default_locale] + locales = [@options[:locale],I18n.default_locale,:en].uniq values = {} locales.each do |locale| I18n.with_locale(locale) do keys.each do |key| @@ -259,10 +259,10 @@ def gen_heading(hnum,title) id = get_id_for(title.gsub(/\s+/,'_')) "<h#{hnum}>" + (@options[:noedit] == true ? "" : "<span class=\"editsection\">&#91;<a href=\"" + @options[:link_handler].section_link(id) + "\" title=\"#{I18n.t('edit section', :name => title)}\">#{I18n.t('edit')}</a>&#93;</span> ") + - "<span class=\"mw-headline\" id=\"#{id}\"><a name=\"#{id}\">#{title}</a></span></h#{hnum}>\n" + "<a name=\"#{id}\"></a><span class=\"mw-headline\" id=\"#{id}\">#{title}</span></h#{hnum}>\n" end def get_id_for(val) val.gsub!(/[^A-Za-z0-9_]+/,'') @idmap ||= {}