module Asciidoctor::PDF::FormattedText::Markup::Charref3

Public Instance Methods

content() click to toggle source
# 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