lib/wikicloth/wiki_buffer.rb in wikicloth-0.6.2 vs lib/wikicloth/wiki_buffer.rb in wikicloth-0.6.3

- old
+ new

@@ -28,10 +28,14 @@ def skip_html? false end + def skip_links? + false + end + def data @data ||= "" end def params @@ -56,11 +60,11 @@ def buffer_type @buffer_type end def to_s - "<p>" + self.params.join("\n") + "</p>" + self.params.join("\n") end def check_globals() return false if self.class != WikiBuffer @@ -72,11 +76,11 @@ # get the parser back on the right track "\n#{cc_temp}".each_char { |c| @buffers[-1].add_char(c) } @indent = nil return true end - if current_char == " " && @indent.nil? && @buffers[-1].class != WikiBuffer::HTMLElement + if current_char == " " && @indent.nil? && ![WikiBuffer::HTMLElement,WikiBuffer::Var].include?(@buffers[-1].class) "\n<pre> ".each_char { |c| @buffers[-1].add_char(c) } @indent = @buffers[-1].object_id return true end end @@ -101,11 +105,11 @@ @buffers << WikiBuffer::Var.new("",@options) end return true # start link - when current_char == '[' && previous_char != '[' + when current_char == '[' && previous_char != '[' && !@buffers[-1].skip_links? @buffers << WikiBuffer::Link.new("",@options) return true # start table when previous_char == '{' && current_char == "|" @@ -215,13 +219,11 @@ tmp += "<#{list_inner_tag_for(cdata.last)}>#{peices[0]}" end @list_data = cdata tmp } - self.data += line + "\n" + self.data += line + "" end - - self.data = "</p><p>" if self.data.blank? self.params << self.data.auto_link self.data = "" else self.data += current_char