Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/mill/html_helpers.rb
Direct Known Subclasses
Constant Summary collapse
- Converters =
{ nil => RubyPants, smart_quotes: RubyPants, markdown: Kramdown::Document, textile: RedCloth, pre: PreText, }
Instance Method Summary collapse
Instance Method Details
#to_html(options = {}) ⇒ Object
111 112 113 114 115 116 117 118 |
# File 'lib/mill/html_helpers.rb', line 111 def to_html(={}) converter = Converters[[:mode]] or raise "Unknown to_html mode: #{[:mode].inspect}" html = Nokogiri::HTML::DocumentFragment.parse(converter.new(self).to_html) if ![:multiline] && (p_elem = html.at_xpath('p')) html = p_elem.children.to_html end html.to_html end |