feat: Add support for parsing Confluence notices

This commit is contained in:
Tom Moor
2023-05-08 16:09:49 -04:00
parent a0df79ea5a
commit 06be19090c

View File

@@ -73,6 +73,20 @@ export default class Notice extends Node {
: undefined, : undefined,
}), }),
}, },
// Confluence parsing
{
tag: "div.confluence-information-macro",
preserveWhitespace: "full",
getAttrs: (dom: HTMLDivElement) => ({
style: dom.className.includes("confluence-information-macro-tip")
? "success"
: dom.className.includes("confluence-information-macro-note")
? "tip"
: dom.className.includes("confluence-information-macro-warning")
? "warning"
: undefined,
}),
},
], ],
toDOM: (node) => { toDOM: (node) => {
let icon, actions; let icon, actions;