Module: SimpleMarkdown::ActionView::Helpers
- Defined in:
- lib/simple_markdown/action_view/helpers.rb
Instance Method Summary collapse
-
#simple_markdown(text) ⇒ Object
Main entry.
Instance Method Details
#simple_markdown(text) ⇒ Object
Main entry
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_markdown/action_view/helpers.rb', line 12 def simple_markdown(text) text = text.gsub(/\r\n?/, "\n").split(/\n/) @text_map = text.map @io = StringIO.new begin while(true) parse_block end rescue StopIteration ensure return @io.string.html_safe end end |