From 06be19090c8df697ac2adbbd3ce015d622eb3221 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 8 May 2023 16:09:49 -0400 Subject: [PATCH] feat: Add support for parsing Confluence notices --- shared/editor/nodes/Notice.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shared/editor/nodes/Notice.tsx b/shared/editor/nodes/Notice.tsx index 788ab5882..9b8939fc3 100644 --- a/shared/editor/nodes/Notice.tsx +++ b/shared/editor/nodes/Notice.tsx @@ -73,6 +73,20 @@ export default class Notice extends Node { : 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) => { let icon, actions;