MCPcopy Index your code
hub / github.com/socketstream/socketstream / escape

Function escape

docs/js/marked.js:978–985  ·  view source on GitHub ↗

* Helpers

(html, encode)

Source from the content-addressed store, hash-verified

976 */
977
978function escape(html, encode) {
979 return html
980 .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
981 .replace(/</g, '&lt;')
982 .replace(/>/g, '&gt;')
983 .replace(/"/g, '&quot;')
984 .replace(/'/g, '&#39;');
985}
986
987function replace(regex, opt) {
988 regex = regex.source;

Callers 2

marked.jsFile · 0.70
markedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected