Module: Asciidoctor::PDF::FormattedText::Markup::Charref3

Defined in:
lib/asciidoctor/pdf/formatted_text/parser.rb

Instance Method Summary collapse

Instance Method Details

#contentObject



831
832
833
834
835
836
837
838
839
# File 'lib/asciidoctor/pdf/formatted_text/parser.rb', line 831

def content
  if (ref_data = elements[1]).terminal?
    { type: :charref, reference_type: :name, value: ref_data.text_value.to_sym }
  elsif ref_data.elements[0].text_value == '#'
    { type: :charref, reference_type: :decimal, value: ref_data.elements[1].text_value.to_i }
  else
    { type: :charref, reference_type: :hex, value: ref_data.elements[1].text_value }
  end
end