MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / escapeHtml

Function escapeHtml

docs/components/shiki.js:5–5  ·  view source on GitHub ↗
(s, quotes = false)

Source from the content-addressed store, hash-verified

3// Shared HTML-escape (editor/playground import this); `quotes` also encodes `"` for attribute-safe output.
4const HTML_ESC = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }
5export const escapeHtml = (s, quotes = false) => s.replace(quotes ? /[&<>"]/g : /[&<>]/g, (c) => HTML_ESC[c])
6
7let hlPromise = null
8function getHighlighter() {

Callers 3

copyPayloadFunction · 0.90
PlaygroundFunction · 0.90
highlightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected