MCPcopy Index your code
hub / github.com/cure53/DOMPurify / svgMath

Function svgMath

scripts/benchmark.js:141–152  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

139}
140
141function svgMath(n) {
142 // Foreign-content blocks: exercises _checkValidNamespace dispatch.
143 let html = '';
144 for (let i = 0; i < n; i++) {
145 html +=
146 `<svg viewBox="0 0 10 10"><g><circle cx="5" cy="5" r="${(i % 4) + 1}"/>` +
147 `<text x="1" y="9">s${i}</text></g></svg>` +
148 `<math><mrow><mi>x</mi><mo>+</mo><mn>${i}</mn></mrow></math>`;
149 }
150
151 return html;
152}
153
154function dirtyMixed(n) {
155 // Realistic dirty input: things to strip, hoist and rewrite.

Callers 1

benchmark.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…