MCPcopy
hub / github.com/SeleniumHQ/selenium / escapeText

Function escapeText

third_party/js/qunit/qunit.js:455–475  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

453 }
454 }
455 function escapeText(str) {
456 if (!str) {
457 return '';
458 }
459
460 // Both single quotes and double quotes (for attributes)
461 return ('' + str).replace(/['"<>&]/g, function (s) {
462 switch (s) {
463 case "'":
464 return '&#039;';
465 case '"':
466 return '&quot;';
467 case '<':
468 return '&lt;';
469 case '>':
470 return '&gt;';
471 case '&':
472 return '&amp;';
473 }
474 });
475 }
476
477 var BOXABLE_TYPES = new StringSet(['boolean', 'number', 'string']);
478

Callers 8

qunit.jsFile · 0.70
getUrlConfigHtmlFunction · 0.70
createModuleListItemFunction · 0.70
appendHeaderFunction · 0.70
appendFilteredTestFunction · 0.70
appendInterfaceFunction · 0.70
getRerunFailedHtmlFunction · 0.70
getNameHtmlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected