Skip to content

Commit 76fd700

Browse files
committed
fix(security): lint compliance (prettier + eqeqeq) for the mXSS sanitizer fix
1 parent 8de2a81 commit 76fd700

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/core/helpers/html/safe-html.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,18 @@ const HTML_INTEGRATION_POINTS = new Set([
3636
* MathML/SVG children and HTML below an integration point are kept.
3737
*/
3838
function isSmuggledForeignHtml(elm: Element): boolean {
39-
if (elm.namespaceURI !== HTML_NAMESPACE || elm.closest('math,svg') === null) {
39+
if (
40+
elm.namespaceURI !== HTML_NAMESPACE ||
41+
elm.closest('math,svg') == null
42+
) {
4043
return false;
4144
}
4245

43-
for (let parent = elm.parentElement; parent; parent = parent.parentElement) {
46+
for (
47+
let parent = elm.parentElement;
48+
parent;
49+
parent = parent.parentElement
50+
) {
4451
const name = parent.nodeName.toLowerCase();
4552

4653
if (name === 'math' || name === 'svg') {

0 commit comments

Comments
 (0)