mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-22 15:04:07 +01:00
This commit is contained in:
parent
4fd844f48c
commit
b73fa77f2b
10 changed files with 41 additions and 23 deletions
|
|
@ -19,6 +19,7 @@ import {avRender} from "../render/av/render";
|
|||
import {hideTooltip} from "../../dialog/tooltip";
|
||||
import {stickyRow} from "../render/av/row";
|
||||
import {updateReadonly as updateReadonlyMethod} from "../breadcrumb/action";
|
||||
import {getContenteditableElement} from "../wysiwyg/getBlock";
|
||||
|
||||
export const onGet = (options: {
|
||||
data: IWebSocketData,
|
||||
|
|
@ -180,6 +181,15 @@ const setHTML = (options: {
|
|||
} else {
|
||||
protyle.wysiwyg.element.innerHTML = options.content;
|
||||
}
|
||||
// https://github.com/siyuan-note/siyuan/issues/10528
|
||||
if (!protyle.block.showAll && protyle.wysiwyg.element.childElementCount === 1 && protyle.wysiwyg.element.firstElementChild.classList.contains("p")) {
|
||||
const editElement = getContenteditableElement(protyle.wysiwyg.element.firstElementChild);
|
||||
if (editElement && editElement.textContent === "") {
|
||||
editElement.classList.add("protyle-wysiwyg--empty");
|
||||
editElement.setAttribute("placeholder", window.siyuan.languages.emptyPlaceholder);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.action.includes(Constants.CB_GET_BACKLINK)) {
|
||||
foldPassiveType(options.expand, protyle.wysiwyg.element);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue