Class: ListString
- Inherits:
-
GformatString
- Object
- String
- GformatString
- ListString
- Defined in:
- lib/models/gformat_string.rb
Overview
importent to put it in first (not good)
Instance Method Summary collapse
Methods inherited from GformatString
Instance Method Details
#format ⇒ Object
14 15 16 17 18 |
# File 'lib/models/gformat_string.rb', line 14 def format content = self + "\n" # add \n content.gsub!(/(^\* [^\n]+\n)+/) {|ul| "<ul>#{ul.gsub!(/\* [^\n]+\n/){|li| "<li>#{li[2..-2]}</li>"} }<\/ul>"} return content[0..-2] # remove \n end |