Disallow empty comments and comments with only whitespaces (#7156)

* fix: disallow empty comments

* fix: avoid full traversal to validate comment

* fix: text

* fix:review

* fix: review
This commit is contained in:
Apoorv Mishra
2024-06-30 11:38:43 +05:30
committed by GitHub
parent 5aa5ba0aa1
commit 63ddc31710
4 changed files with 142 additions and 3 deletions

View File

@@ -166,6 +166,8 @@ export default class Image extends SimpleImage {
["p", { class: "caption" }, 0],
];
},
toPlainText: (node) =>
node.attrs.alt ? `(image: ${node.attrs.alt})` : "(image)",
};
}