MCPcopy
hub / github.com/nbubna/store / escapeText

Function escapeText

libs/qunit/qunit.js:1381–1401  ·  view source on GitHub ↗

* Escape text for attribute or text content.

( s )

Source from the content-addressed store, hash-verified

1379 * Escape text for attribute or text content.
1380 */
1381function escapeText( s ) {
1382 if ( !s ) {
1383 return "";
1384 }
1385 s = s + "";
1386 // Both single quotes and double quotes (for attributes)
1387 return s.replace( /['"<>&]/g, function( s ) {
1388 switch( s ) {
1389 case '\'':
1390 return '&#039;';
1391 case '"':
1392 return '&quot;';
1393 case '<':
1394 return '&lt;';
1395 case '>':
1396 return '&gt;';
1397 case '&':
1398 return '&amp;';
1399 }
1400 });
1401}
1402
1403function synchronize( callback, last ) {
1404 config.queue.push( callback );

Callers 1

qunit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…