Skip to content

Commit

Permalink
escape slash
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaleleka committed May 12, 2023
1 parent 4c8644b commit 5b79867
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/scriptlets/prevent-element-src-loading.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ const onErrorTestTag = (assert, url, testPassed, shouldLoad) => {
}
done();
};
// It's necessary to use the slash like this,
// otherwise the tests will be displayed incorrectly after the build
const slash = '/';
const html = `<script src="${url}" onload="scriptLoaded()" onerror="scriptBlocked()"><${slash}script>`;
const html = `<script src="${url}" onload="scriptLoaded()" onerror="scriptBlocked()"><\\/script>`;
const scriptEl = document.createRange().createContextualFragment(html);
document.body.appendChild(scriptEl);
};
Expand Down

0 comments on commit 5b79867

Please sign in to comment.