Class: Marko::Markup::LostIndex

Inherits:
Inspector show all
Defined in:
lib/marko/markup/validator.rb

Instance Method Summary collapse

Methods inherited from Inspector

#call

Instance Method Details

#report(errs) ⇒ Object



79
80
81
82
# File 'lib/marko/markup/validator.rb', line 79

def report(errs)
  # lost index [a, b] src/source2.md:22 >> ## header
  errs.map{|orig, lost| "lost index [#{lost.join(', ')}] in #{orig}\n" }
end

#select(tree) ⇒ Object



72
73
74
75
76
77
# File 'lib/marko/markup/validator.rb', line 72

def select(tree)
  lost = proc{|n| n.order_index.reject{|i| n.find_item(i)}}
  tree
    .select{|n| n.order_index.any? && lost.(n).any?}
    .map{|n| [n[:origin], lost.(n)]} # @todo second time calculation
end