mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
editor: disable collapsible headings inside tables
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -184,11 +184,14 @@ export const Heading = TiptapHeading.extend({
|
|||||||
if (typeof pos !== "number") return;
|
if (typeof pos !== "number") return;
|
||||||
|
|
||||||
const resolvedPos = editor.state.doc.resolve(pos);
|
const resolvedPos = editor.state.doc.resolve(pos);
|
||||||
const calloutAncestor = findParentNodeClosestToPos(
|
const forbiddenParents = ["callout", "table"];
|
||||||
resolvedPos,
|
if (
|
||||||
(node) => node.type.name === "callout"
|
findParentNodeClosestToPos(resolvedPos, (node) =>
|
||||||
);
|
forbiddenParents.includes(node.type.name)
|
||||||
if (calloutAncestor) return;
|
)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isClickWithinBounds(
|
isClickWithinBounds(
|
||||||
|
|||||||
@@ -978,6 +978,21 @@ del.diffdel {
|
|||||||
display: none;
|
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"] {
|
[data-hidden="true"] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user