fix: Prevent both img parseDOM rules matching (#9938)

closes #9930
This commit is contained in:
Tom Moor
2025-08-14 22:09:24 -04:00
committed by GitHub
parent e2c8ee7b54
commit dc0df7c7e9
+5
View File
@@ -137,6 +137,11 @@ export default class Image extends SimpleImage {
{
tag: "img",
getAttrs: (dom: HTMLImageElement) => {
// Don't parse images from our own editor with this rule.
if (dom.parentElement?.classList.contains("image")) {
return false;
}
// First try HTML attributes
let width = dom.getAttribute("width");
let height = dom.getAttribute("height");