MCPcopy
hub / github.com/witheve/Eve / escapeXml

Function escapeXml

src/commonmark.js:959–969  ·  view source on GitHub ↗
(s, preserve_entities)

Source from the content-addressed store, hash-verified

957};
958
959var escapeXml = function(s, preserve_entities) {
960 if (reXmlSpecial.test(s)) {
961 if (preserve_entities) {
962 return s.replace(reXmlSpecialOrEntity, replaceUnsafeChar);
963 } else {
964 return s.replace(reXmlSpecial, replaceUnsafeChar);
965 }
966 } else {
967 return s;
968 }
969};
970
971module.exports = { unescapeString: unescapeString,
972 normalizeURI: normalizeURI,

Callers 1

tagFunction · 0.85

Calls 1

testMethod · 0.45

Tested by

no test coverage detected