Class: Metanorma::Standoc::StdLinkInlineMacro

Inherits:
Asciidoctor::Extensions::InlineMacroProcessor
  • Object
show all
Defined in:
lib/metanorma/standoc/macros_link.rb

Instance Method Summary collapse

Instance Method Details

#process(parent, _target, attrs) ⇒ Object



69
70
71
72
73
74
75
76
77
78
# File 'lib/metanorma/standoc/macros_link.rb', line 69

def process(parent, _target, attrs)
  t = attrs["text"]
  t = if /,/.match?(t)
        t.sub(/,/, "%")
      else
        "#{t}%"
      end
  create_anchor(parent, "hidden=#{t}",
                type: :xref, target: "_#{UUIDTools::UUID.random_create}")
end