Class: QDA::Filters::Templates::ExtendedPreprocessor

Inherits:
PageTemplate::DefaultPreprocessor
  • Object
show all
Defined in:
lib/weft/filters/templates.rb

Class Method Summary collapse

Class Method Details

.html_paras(string) ⇒ Object

Takes string string and splits it into HTML paragraphs, taking a blank line and a newline as marking the start of a paragraph. Does HTML escaping of the paragraph contents



24
25
26
27
28
# File 'lib/weft/filters/templates.rb', line 24

def html_paras(string)
  string.split(/\n\s*\n/).inject('') do | out, para |
    out << "<p>" << html(para) << "</p>\n"
  end
end