Class: PointBlank::Parsing::LinkReferenceOverlay
- Inherits:
-
NullOverlay
- Object
- NullParser
- NullOverlay
- PointBlank::Parsing::LinkReferenceOverlay
- Includes:
- LinkSharedMethods
- Defined in:
- lib/mmmd/blankshell.rb
Overview
Overlay for link reference definitions
Instance Method Summary collapse
-
#initialize ⇒ LinkReferenceOverlay
constructor
A new instance of LinkReferenceOverlay.
-
#process(block, **_lazy) ⇒ nil, Class
Process block after it closed.
Methods included from LinkSharedMethods
#balanced?, #find_balanced_end, #normalize_label, #process_destination, #process_title, #read_destination, #read_label, #read_properties, #read_return_label, #read_title
Methods inherited from NullOverlay
Methods inherited from NullParser
begin?, #close, #consume, #parsed_content
Constructor Details
#initialize ⇒ LinkReferenceOverlay
Returns a new instance of LinkReferenceOverlay.
846 847 848 849 |
# File 'lib/mmmd/blankshell.rb', line 846 def initialize super @definitions = {} end |
Instance Method Details
#process(block, **_lazy) ⇒ nil, Class
Process block after it closed
852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 |
# File 'lib/mmmd/blankshell.rb', line 852 def process(block, **_lazy) text = block.content loop do prev = text label, text = read_label(text) break prev unless label destination, text = read_destination(text) break prev unless destination title, text = read_title(text) push_definition(label, destination, title) end modify(block, text) nil end |