We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fad1fe commit 675bbeaCopy full SHA for 675bbea
src/render_latex.js
@@ -28,11 +28,15 @@ function escapeChar(ch) {
28
case "~": return "\\textasciitilde "
29
case "^": return "\\textasciicircum "
30
case "\\": return "\\textbackslash "
31
+ case "/": return "\/\\allowbreak "
32
default: return "\\" + ch
33
}
34
35
function escape(str) {
- return String(str).replace(/[&%$#_{}~^\\]/g, escapeChar)
36
+ return String(str).replace(/[&%$#_{}~^\\]|\w(\/)\w/g, (match, group) => {
37
+ if (group) return match[0] + escapeChar(group) + match[2]
38
+ return escapeChar(match)
39
+ })
40
41
function miniEscape(str) { return str.replace(/[`]/g, escapeChar) }
42
0 commit comments