Class: Marko::Markup::LostParent

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



65
66
67
68
# File 'lib/marko/markup/validator.rb', line 65

def report(errs)
  # lost parent [ref] src/source2.md:22 >> ## header
  errs.map{|n| "lost parent [#{n[:parent]}] found in #{n[:origin]}\n"}
end

#select(tree) ⇒ Object



61
62
63
# File 'lib/marko/markup/validator.rb', line 61

def select(tree)
  tree.select{|n| n[:parent] && n.parent_id != n[:parent]}
end