Class: PointBlank::Parsing::OLElementParser

Inherits:
NullParser
  • Object
show all
Defined in:
lib/mmmd/blankshell.rb

Overview

Unorder list block (element)

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NullParser

#close, #initialize, #parsed_content

Constructor Details

This class inherits a constructor from PointBlank::Parsing::NullParser

Class Method Details

.begin?(line) ⇒ Boolean

Returns:

  • (Boolean)


650
651
652
# File 'lib/mmmd/blankshell.rb', line 650

def self.begin?(line)
  line.match?(/\A {0,3}(\d+)([).])(\s+)/)
end

Instance Method Details

#applyprops(block) ⇒ Object



664
665
666
# File 'lib/mmmd/blankshell.rb', line 664

def applyprops(block)
  block.properties["number"] = @num.to_i
end

#consume(line, _parent = nil, **_hargs) ⇒ Array(String, Boolean)

Consume line markers

Parameters:

  • line (String)

Returns:

  • (Array(String, Boolean))


655
656
657
658
659
660
661
# File 'lib/mmmd/blankshell.rb', line 655

def consume(line, _parent = nil, **_hargs)
  return [nil, true] unless continues?(line)

  self.open(line)

  [normalize(line), true]
end