Module: HParser::Hatena
- Included in:
- Block::Head, Block::ListItem, Block::P, Block::Pre, Block::Quote, Block::SuperPre, Block::TableCell, Block::TableHeader
- Defined in:
- lib/hparser/hatena.rb
Overview
This module provide to_hatena
method. This method is intended to convert hatena format node to hatena format.
For example:
Hatena::Parser.parse('*foo').to_html # -> *foo
Hatena::Parser.parse('>|bar|<').to_html # -> >|bar|<
Please see also HParser::Text
Instance Method Summary collapse
Instance Method Details
#to_hatena ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hparser/hatena.rb', line 15 def to_hatena content = hatena_content if content.class == Array then content = content.map{|x| x.to_hatena}.join end if self.respond_to? :hatena_filter,true content = hatena_filter content end content+"\n" end |