Module: HParser::Text

Overview

This module provide to_text method. This method is intended to convert hatena format to text.

For example:

Hatena::Parser.parse('*foo').to_html # -> foo
Hatena::Parser.parse('>|bar|<').to_html # -> bar

Please see also HParser::Hatena

Instance Method Summary collapse

Instance Method Details

#to_textObject



15
16
17
18
19
20
21
# File 'lib/hparser/text.rb', line 15

def to_text
  content = text_content
  if content.class == Array then
    content = content.map{|x| x.to_text}.join
  end
  content
end