MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / escapeChar

Function escapeChar

src/render_html.mjs:43–45  ·  view source on GitHub ↗
(ch)

Source from the content-addressed store, hash-verified

41if (epub) chapters.push("hints")
42
43function escapeChar(ch) {
44 return ch == "<" ? "&lt;" : ch == ">" ? "&gt;" : ch == "&" ? "&amp;" : "&quot;"
45}
46function escape(str) { return str.replace(/[<>&"]/g, escapeChar) }
47
48// FIXME http highlighting

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected