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
# File 'lib/metanorma/standoc/macros_link.rb', line 69

def process(parent, _target, attrs)
  t = attrs["text"]
  t = if t.include?(",")
        t.sub(/,/, "%")
      else "#{t}%"
      end
  target = attrs["text"].sub(/,.*$/, "").gsub(":", "_") # special char
  create_anchor(parent, "hidden=#{t}", type: :xref, target: target)
end