Merge pull request #8858 from 01zulfi/editor/disable-collapsible-headings-in-table

editor: disable collapsible headings inside tables
This commit is contained in:
Abdullah Atta
2025-11-12 11:30:38 +05:00
committed by GitHub
2 changed files with 23 additions and 5 deletions

View File

@@ -184,11 +184,14 @@ export const Heading = TiptapHeading.extend({
if (typeof pos !== "number") return;
const resolvedPos = editor.state.doc.resolve(pos);
const calloutAncestor = findParentNodeClosestToPos(
resolvedPos,
(node) => node.type.name === "callout"
);
if (calloutAncestor) return;
const forbiddenParents = ["callout", "table"];
if (
findParentNodeClosestToPos(resolvedPos, (node) =>
forbiddenParents.includes(node.type.name)
)
) {
return;
}
if (
isClickWithinBounds(

View File

@@ -978,6 +978,21 @@ del.diffdel {
display: none;
}
.ProseMirror table h1::before,
.ProseMirror table h2::before,
.ProseMirror table h3::before,
.ProseMirror table h4::before,
.ProseMirror table h5::before,
.ProseMirror table h6::before,
.ProseMirror table h1::after,
.ProseMirror table h2::after,
.ProseMirror table h3::after,
.ProseMirror table h4::after,
.ProseMirror table h5::after,
.ProseMirror table h6::after {
display: none;
}
[data-hidden="true"] {
display: none !important;
}