Method: Metanorma::Standoc::Utils#xml_encode
- Defined in:
- lib/metanorma/standoc/utils.rb
#xml_encode(text) ⇒ Object
111 112 113 114 115 116 117 |
# File 'lib/metanorma/standoc/utils.rb', line 111 def xml_encode(text) @c.encode(text, :basic, :hexadecimal) .gsub("&gt;", ">").gsub("&lt;", "<").gsub("&amp;", "&") .gsub(">", ">").gsub("<", "<").gsub("&", "&") .gsub(""", '"').gsub("
", "\n").gsub("&#", "&#") .gsub("'", "'") end |