MCPcopy
hub / github.com/methodofaction/Method-Draw / escapeHtml

Function escapeHtml

test/qunit/qunit.js:804–819  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

802}
803
804function escapeHtml(s) {
805 if (!s) {
806 return "";
807 }
808 s = s + "";
809 return s.replace(/[\&"<>\\]/g, function(s) {
810 switch(s) {
811 case "&": return "&amp;";
812 case "\\": return "\\\\";
813 case '"': return '\"';
814 case "<": return "&lt;";
815 case ">": return "&gt;";
816 default: return s;
817 }
818 });
819}
820
821function synchronize( callback ) {
822 config.queue.push( callback );

Callers 1

qunit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected