Module: RD::RD2HTMLExtVisitor::EnableBr

Defined in:
lib/rd/rd2html-ext-lib.rb

Overview

Enable

Instance Method Summary collapse

Instance Method Details

#apply_to_TextBlock(element, content) ⇒ Object



128
129
130
131
132
133
134
135
136
137
# File 'lib/rd/rd2html-ext-lib.rb', line 128

def apply_to_TextBlock(element, content)
  if (element.parent.is_a?(ItemListItem) or
      element.parent.is_a?(EnumListItem)) and
      consist_of_one_textblock?(element.parent)
    content.join.chomp
  else
    content = content.delete_if{|x| x == "\n"}.join("").gsub(/\n/, "<br />\n")
    %Q[<p>#{content.chomp}</p>]
  end
end