From 3b43460a0a3881a6bbedf5ffa981ec309bdadfbd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 29 Jul 2023 23:42:26 -0400 Subject: [PATCH] fix: Restrict content in notices, closes #5624 --- shared/editor/nodes/BulletList.ts | 2 +- shared/editor/nodes/CheckboxList.ts | 2 +- shared/editor/nodes/Notice.tsx | 2 +- shared/editor/nodes/OrderedList.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/editor/nodes/BulletList.ts b/shared/editor/nodes/BulletList.ts index b45344ea2..0a042ff00 100644 --- a/shared/editor/nodes/BulletList.ts +++ b/shared/editor/nodes/BulletList.ts @@ -17,7 +17,7 @@ export default class BulletList extends Node { get schema(): NodeSpec { return { content: "list_item+", - group: "block", + group: "block list", parseDOM: [{ tag: "ul" }], toDOM: () => ["ul", 0], }; diff --git a/shared/editor/nodes/CheckboxList.ts b/shared/editor/nodes/CheckboxList.ts index 8d06177c0..6cbd29340 100644 --- a/shared/editor/nodes/CheckboxList.ts +++ b/shared/editor/nodes/CheckboxList.ts @@ -16,7 +16,7 @@ export default class CheckboxList extends Node { get schema(): NodeSpec { return { - group: "block", + group: "block list", content: "checkbox_item+", toDOM: () => ["ul", { class: this.name }, 0], parseDOM: [ diff --git a/shared/editor/nodes/Notice.tsx b/shared/editor/nodes/Notice.tsx index d2e7caf65..f0f0dce18 100644 --- a/shared/editor/nodes/Notice.tsx +++ b/shared/editor/nodes/Notice.tsx @@ -26,7 +26,7 @@ export default class Notice extends Node { default: "info", }, }, - content: "block+", + content: "(list | blockquote | hr | paragraph | heading | attachment)+", group: "block", defining: true, draggable: true, diff --git a/shared/editor/nodes/OrderedList.ts b/shared/editor/nodes/OrderedList.ts index 10604b77e..2e35daf4a 100644 --- a/shared/editor/nodes/OrderedList.ts +++ b/shared/editor/nodes/OrderedList.ts @@ -23,7 +23,7 @@ export default class OrderedList extends Node { }, }, content: "list_item+", - group: "block", + group: "block list", parseDOM: [ { tag: "ol",