Class: HParser::Block::P
- Inherits:
-
Object
- Object
- HParser::Block::P
- Includes:
- Collectable, Hatena, Html, Latex, Text
- Defined in:
- lib/hparser/block/p.rb,
lib/hparser/html.rb,
lib/hparser/text.rb,
lib/hparser/latex.rb,
lib/hparser/hatena.rb
Overview
Normal line parser.
At hatena format, a line which is not parsed by any other parser is paragraph.
Constant Summary
Constants included from Html
Instance Attribute Summary collapse
-
#content ⇒ Object
(also: #html_content, #text_content, #latex_content, #hatena_content)
readonly
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(content) ⇒ P
constructor
A new instance of P.
- #to_latex ⇒ Object
Methods included from Hatena
Methods included from Text
Methods included from Html
Constructor Details
#initialize(content) ⇒ P
Returns a new instance of P.
46 47 48 |
# File 'lib/hparser/block/p.rb', line 46 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly) Also known as: html_content, text_content, latex_content, hatena_content
Returns the value of attribute content.
38 39 40 |
# File 'lib/hparser/block/p.rb', line 38 def content @content end |
Class Method Details
.<=>(o) ⇒ Object
54 55 56 57 |
# File 'lib/hparser/block/p.rb', line 54 def self.<=>(o) # This parser should be last. o.class == P ? nil : 1 end |
Instance Method Details
#==(o) ⇒ Object
50 51 52 |
# File 'lib/hparser/block/p.rb', line 50 def ==(o) self.class == o.class and self.content == o.content end |
#to_latex ⇒ Object
64 65 66 67 68 |
# File 'lib/hparser/latex.rb', line 64 def to_latex content = super content += "\n\n" content end |