MCPcopy Create free account
hub / github.com/ampproject/amphtml / escapeHtml

Function escapeHtml

build-system/tasks/visual-diff/helpers.js:19–21  ·  view source on GitHub ↗

* Escapes a string of HTML elements to HTML entities. * * @param {string} html HTML as string to escape. * @return {string}

(html)

Source from the content-addressed store, hash-verified

17 * @return {string}
18 */
19function escapeHtml(html) {
20 return html.replace(HTML_ESCAPE_REGEX, (c) => HTML_ESCAPE_CHARS[c]);
21}
22
23/**
24 * Returns a Promise that resolves after the specified number of milliseconds.

Callers 1

snapshotWebpagesFunction · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected