Method: MaRuKu::Out::Latex#latex_escape
- Defined in:
- lib/maruku/output/to_latex.rb
#latex_escape(source) ⇒ Object
the ultimate escaping (is much better than using verb)
344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/maruku/output/to_latex.rb', line 344 def latex_escape(source) s=""; source.each_byte do |b| if b == ?\ s << '~' elsif SAFE_CHARS.include? b s << b else s += "\\char%d" % b end end s end |