Method: IsoDoc::PresentationXMLConvert#xml_encode_attr

Defined in:
lib/isodoc/presentation_function/index.rb

#xml_encode_attr(str) ⇒ Object



140
141
142
143
144
145
# File 'lib/isodoc/presentation_function/index.rb', line 140

def xml_encode_attr(str)
  HTMLEntities.new.encode(str, :basic, :hexadecimal)
    .gsub(/&#x([^;]+);/) do |_x|
    "&#x#{$1.upcase};"
  end
end