(ch)
| 30 | .concat(['hints']) |
| 31 | |
| 32 | function escapeChar(ch) { |
| 33 | switch (ch) { |
| 34 | case "~": return "\\textasciitilde " |
| 35 | case "^": return "\\textasciicircum " |
| 36 | case "\\": return "\\textbackslash " |
| 37 | case "/": return "\\slash " |
| 38 | case '"': return "\\textquotedbl{}" |
| 39 | default: return "\\" + ch |
| 40 | } |
| 41 | } |
| 42 | function escape(str) { |
| 43 | return String(str).replace(/[&%$#_{}~^\\"]|\w(\/)\w/g, (match, group) => { |
| 44 | if (group) return match[0] + escapeChar(group) + match[2] |