Class: Metanorma::Standoc::FormOptionMacro

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

Instance Method Summary collapse

Instance Method Details

#process(parent, _target, attr) ⇒ Object



55
56
57
58
59
60
# File 'lib/metanorma/standoc/macros_form.rb', line 55

def process(parent, _target, attr)
  m = %w(disabled value)
    .map { |a| attr[a] ? " #{a}='#{attr[a]}'" : nil }.compact
  out = Asciidoctor::Inline.new(parent, :quoted, attr["text"]).convert
  %{<option #{m.join}>#{out}</option>}
end