Class: HParser::Block::Empty

Inherits:
Object
  • Object
show all
Includes:
Collectable, 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

Blank line parser. This parser should be use with HParser::Block::P.

This parser can parse blank line.

For example:

aaaa
<blank>
<blonk>

First line and second line is parsed with HParser::Block::P. And third line is parsed with HParser::Block::Empty.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(scanner, context, inlines) ⇒ Object



21
22
23
24
25
# File 'lib/hparser/block/p.rb', line 21

def self.parse(scanner,context,inlines)
  if scanner.scan('') then
    Empty.new
  end
end

Instance Method Details

#==(o) ⇒ Object



27
28
29
# File 'lib/hparser/block/p.rb', line 27

def ==(o)
  o.class == self.class
end

#to_hatenaObject



35
36
37
# File 'lib/hparser/hatena.rb', line 35

def to_hatena
  ''
end

#to_htmlObject



94
# File 'lib/hparser/html.rb', line 94

def to_html() '<br />' end

#to_latexObject



74
# File 'lib/hparser/latex.rb', line 74

def to_latex() "\n\n" end

#to_textObject



37
38
39
# File 'lib/hparser/text.rb', line 37

def to_text
  ""
end