🎨 The embed block of a heading supports hiding the heading itself

This commit is contained in:
Achuan-2 2025-09-25 16:54:01 +08:00 committed by GitHub
parent a6e4baee99
commit ee5eb01c52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 208 additions and 45 deletions

View file

@ -59,7 +59,7 @@ export const blockRender = (protyle: IProtyle, element: Element, top?: number) =
fetchPost("/api/search/getEmbedBlock", {
embedBlockID: item.getAttribute("data-node-id"),
includeIDs: promiseIds,
headingMode: item.getAttribute("custom-heading-mode") === "1" ? 1 : 0,
headingMode: ["0", "1", "2"].includes(item.getAttribute("custom-heading-mode")) ? parseInt(item.getAttribute("custom-heading-mode")) : window.siyuan.config.editor.headingEmbedMode,
breadcrumb
}, (response) => {
renderEmbed(response.data.blocks || [], protyle, item, top);
@ -74,7 +74,7 @@ export const blockRender = (protyle: IProtyle, element: Element, top?: number) =
fetchPost("/api/search/getEmbedBlock", {
embedBlockID: item.getAttribute("data-node-id"),
includeIDs,
headingMode: item.getAttribute("custom-heading-mode") === "1" ? 1 : 0,
headingMode: ["0", "1", "2"].includes(item.getAttribute("custom-heading-mode")) ? parseInt(item.getAttribute("custom-heading-mode")) : window.siyuan.config.editor.headingEmbedMode,
breadcrumb
}, (response) => {
renderEmbed(response.data.blocks || [], protyle, item, top);
@ -89,7 +89,7 @@ export const blockRender = (protyle: IProtyle, element: Element, top?: number) =
fetchPost("/api/search/searchEmbedBlock", {
embedBlockID: item.getAttribute("data-node-id"),
stmt: content,
headingMode: item.getAttribute("custom-heading-mode") === "1" ? 1 : 0,
headingMode: ["0", "1", "2"].includes(item.getAttribute("custom-heading-mode")) ? parseInt(item.getAttribute("custom-heading-mode")) : window.siyuan.config.editor.headingEmbedMode,
excludeIDs: [item.getAttribute("data-node-id"), protyle.block.rootID],
breadcrumb
}, (response) => {