dwww Home | Show directory contents | Find package

library(testit)

assert(
  'escape_latex() sanitizes backslashes and {}',
  escape_latex('\\') == '\\textbackslash{}',
  escape_latex('\\{}') == '\\textbackslash{}\\{\\}',
  escape_latex('{\\}') == '\\{\\textbackslash{}\\}',
  escape_latex('~!@#$%^&*()') == '~!@#$%^&*()'
)

assert(
  'escape_html() escapes HTML chars',
  escape_html('&"<>') == '&amp;&quot;&lt;&gt;',
  escape_html('~!@#$%^&*()') == '~!@#$%^&amp;*()'
)

Generated by dwww version 1.15 on Sat May 18 13:07:30 CEST 2024.