Class: ListString

Inherits:
GformatString show all
Defined in:
lib/models/gformat_string.rb

Overview

importent to put it in first (not good)

Instance Method Summary collapse

Methods inherited from GformatString

#to_html_format

Instance Method Details

#formatObject



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