Class: Marko::Markup::MLink
Instance Method Summary collapse
-
#subs(sample, node) ⇒ Object
the macro requires obj [Decorator].
Methods inherited from Macro
Instance Method Details
#subs(sample, node) ⇒ Object
the macro requires obj [Decorator]
65 66 67 68 69 70 71 72 |
# File 'lib/marko/markup/macro.rb', line 65 def subs(sample, node) capture = /\[\[([\w\.]*)\]\]/ ref = sample .match(capture) .captures.first obj = node.find_node(ref) obj ? obj.ref : "[#{ref}](#lost-link)" end |