lib/wikicloth/wiki_buffer.rb in wikicloth-0.1.5 vs lib/wikicloth/wiki_buffer.rb in wikicloth-0.1.6

- old
+ new

@@ -115,23 +115,13 @@ when current_char == "\n" if @options[:extended_markup] == true self.data.gsub!(/---([^-]+)---/,"<strike>\\1</strike>") self.data.gsub!(/_([^_]+)_/,"<u>\\1</u>") end - self.data.gsub!(/__([a-zA-Z0-9]+)__/) { |r| - case $1 - when "NOEDITSECTION" - @noeditsection = true - end - "" - } + self.data.gsub!(/__TOC__/) { |r| @options[:link_handler].toc(@options[:sections]) } self.data.gsub!(/^([-]{4,})/) { |r| "<hr />" } self.data.gsub!(/^([=]{1,6})\s*(.*?)\s*(\1)/) { |r| - @section_count += 1 - "<h#{$1.length}>" + (@noeditsection == true ? "" : - "<span class=\"editsection\">[<a href=\"" + @options[:link_handler].section_link(@section_count) + - "\" title=\"Edit section: #{$2}\">edit</a>]</span>") + - " <span class=\"mw-headline\">#{$2}</span></h#{$1.length}>" + "<h#{$1.length}>#{$2}</h#{$1.length}>" } self.data.gsub!(/([\']{2,5})(.*?)(\1)/) { |r| tmp = "<i>#{$2}</i>" if $1.length == 2 tmp = "<b>#{$2}</b>" if $1.length == 3 tmp = "<b>'#{$2}'</b>" if $1.length == 4