MCPcopy Index your code
hub / github.com/nodejs/node / escapeAttribute

Function escapeAttribute

lib/internal/test_runner/reporter/junit.js:21–23  ·  view source on GitHub ↗
(s = '')

Source from the content-addressed store, hash-verified

19const HOSTNAME = hostname();
20
21function escapeAttribute(s = '') {
22 return escapeContent(RegExpPrototypeSymbolReplace(/"/g, RegExpPrototypeSymbolReplace(/\n/g, s, '
'), '"'));
23}
24
25function escapeContent(s = '') {
26 return RegExpPrototypeSymbolReplace(/</g, RegExpPrototypeSymbolReplace(/(&)(?!#\d{1,7};)/g, s, '&amp;'), '&lt;');

Callers 1

treeToXMLFunction · 0.85

Calls 1

escapeContentFunction · 0.85

Tested by

no test coverage detected