diff --git a/packages/core/src/pm-nodes/BlockContainer.ts b/packages/core/src/pm-nodes/BlockContainer.ts index aad3429a0b..2b1e6e674a 100644 --- a/packages/core/src/pm-nodes/BlockContainer.ts +++ b/packages/core/src/pm-nodes/BlockContainer.ts @@ -78,7 +78,7 @@ export const BlockContainer = Node.create<{ parseHTML() { return [ { - tag: "div[data-node-type=" + this.name + "]", + tag: `div[data-node-type="${this.name}"]`, getAttrs: (element) => { if (typeof element === "string") { return false; diff --git a/packages/core/src/schema/blocks/createSpec.ts b/packages/core/src/schema/blocks/createSpec.ts index 2faed2e760..6971dc732c 100644 --- a/packages/core/src/schema/blocks/createSpec.ts +++ b/packages/core/src/schema/blocks/createSpec.ts @@ -157,7 +157,7 @@ export function getParseRules< const rules: TagParseRule[] = [ isLayoutBlock ? { - tag: `[data-node-type=${config.type}]`, + tag: `[data-node-type="${config.type}"]`, // Scope the round-trip parse to the frame's slot, so chrome the // frame draws around it (button labels, captions, ...) doesn't // parse back as document content. HTML without the marker @@ -166,7 +166,7 @@ export function getParseRules< findFrameSlot(el as HTMLElement) ?? (el as HTMLElement), } : { - tag: "[data-content-type=" + config.type + "]", + tag: `[data-content-type="${config.type}"]`, contentElement: ".bn-inline-content", preserveWhitespace: config.content === "plain" ? "full" : undefined, },