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)


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

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))


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

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

  [normalize(line), true]
end