Module: SiSU_XHTML_EPUB2_Format::SanitizeXML

Defined in:
lib/sisu/xhtml_epub2_format.rb

Class Method Summary collapse

Class Method Details

.xml(x) ⇒ Object



1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
# File 'lib/sisu/xhtml_epub2_format.rb', line 1235

def self.xml(x)
  if x.is_a?(String)
    x=x.gsub(/ /,' ') if Ep[:alt]==:on
    x.gsub(/&/,'&').
      gsub(/</,"&lt;").gsub(/>/,"&gt;").
      gsub(/#{Dx[:url_o]}/,Dx[:url_o_xml]).gsub(/#{Dx[:url_c]}/,Dx[:url_c_xml]).
      #gsub(/</,'&#60;').gsub(/>/,'&#62;').
      gsub(/\\\\/,'<br />').
      gsub(/&lt;br(?: \/)?&gt;/,'<br />')
  else x
  end
end