class Asciidoctor::Standoc::VariantInlineMacro

Public Instance Methods

process(parent, target, attrs) click to toggle source
# File lib/asciidoctor/standoc/macros.rb, line 169
def process(parent, target, attrs)
  /^(?<lang>[^-]*)(-(?<script>.*))?$/ =~ target
  out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
  if script
    %{<variant lang=#{lang} script=#{script}>#{out}</variant>}
  else
    %{<variant lang=#{lang}>#{out}</variant>}
  end
end