Class: PointBlank::Parsing::QuoteParser

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

Overview

Quote block

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)


705
706
707
# File 'lib/mmmd/blankshell.rb', line 705

def self.begin?(line)
  line.start_with?(/\A {0,3}>(?: \S|)/)
end

Instance Method Details

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

Consume line markers

Parameters:

  • line (String)

Returns:

  • (Array(String, Boolean))


710
711
712
713
714
# File 'lib/mmmd/blankshell.rb', line 710

def consume(line, _parent = nil, **_hargs)
  return [nil, true] unless line.start_with?(/\A {0,3}>(?: \S|)/)

  [normalize(line), true]
end