@diplodoc/transform 4.76.5 → 4.76.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/_yfm-only.css.map +1 -1
- package/dist/css/_yfm-only.min.css.map +1 -1
- package/dist/css/base.css.map +1 -1
- package/dist/css/base.min.css.map +1 -1
- package/dist/css/print.css.map +1 -1
- package/dist/css/yfm.css.map +1 -1
- package/dist/css/yfm.min.css.map +1 -1
- package/lib/plugins/images/index.js +11 -3
- package/lib/plugins/images/index.js.map +1 -1
- package/lib/sanitize.js +7 -0
- package/lib/sanitize.js.map +1 -1
- package/package.json +1 -1
- package/src/transform/plugins/images/index.ts +12 -3
- package/src/transform/sanitize.ts +9 -0
|
@@ -791,6 +791,15 @@ function sanitizeStyleAttrs(dom: cheerio.CheerioAPI, cssWhiteList: CssWhiteList)
|
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
+
// cssfilter whitelist is HTML-oriented and strips SVG presentation attrs (stroke, etc.)
|
|
795
|
+
if (dom(element).closest('svg').length > 0) {
|
|
796
|
+
if (!isSafeCssValue('style', styleAttrValue)) {
|
|
797
|
+
dom(element).removeAttr('style');
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
|
|
794
803
|
dom(element).attr('style', cssSanitizer.process(styleAttrValue));
|
|
795
804
|
});
|
|
796
805
|
}
|