MCPcopy
hub / github.com/braziljs/eloquente-javascript / escapeComplexScripts

Function escapeComplexScripts

src/render_latex.mjs:68–74  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

66}
67
68function escapeComplexScripts(string) {
69 return string.replace(/[^\u0000-\u0600→“”…←‘’]+/g, m => {
70 if (/[\u0600-\u06ff]/.test(m)) m = "\\textarab{" + m + "}"
71 else if (/[\u4E00-\u9FA5]/.test(m)) m = "\\cjkfont{" + m + "}"
72 return `$<${m}>$`
73 })
74}
75
76function id(token) {
77 let id = token.attrGet("id")

Callers 1

fenceFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected