MCPcopy
hub / github.com/Dynalon/mdwiki / escape

Function escape

js/marked.js:945–952  ·  view source on GitHub ↗

* Helpers

(html, encode)

Source from the content-addressed store, hash-verified

943 */
944
945 function escape(html, encode) {
946 return html
947 .replace(!encode ? /&(?!#?\w+;)/g : /&/g, "&")
948 .replace(/</g, "&lt;")
949 .replace(/>/g, "&gt;")
950 .replace(/"/g, "&quot;")
951 .replace(/'/g, "&#39;");
952 }
953
954 function replace(regex, opt) {
955 regex = regex.source;

Callers 2

marked.jsFile · 0.85
markedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected