Vanessa 2024-05-10 23:10:57 +08:00
parent 0ea73f580e
commit d5038ac5be

View file

@ -11,7 +11,7 @@ export const resize = (protyle: IProtyle) => {
const MIN_ABS = 4;
// 不能 clearTimeout否则 split 时左侧无法 resize
setTimeout(() => {
if(!protyle.disabled) {
if (!protyle.disabled) {
const contentRect = protyle.contentElement.getBoundingClientRect();
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
if (item.querySelector(".av__title")) {
@ -28,11 +28,13 @@ export const resize = (protyle: IProtyle) => {
}
});
}
if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) {
protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber").forEach((block: HTMLElement) => {
protyle.wysiwyg.element.querySelectorAll(".code-block .protyle-linenumber").forEach((block: HTMLElement) => {
if ((window.siyuan.config.editor.codeSyntaxHighlightLineNum && block.parentElement.getAttribute("lineNumber") !== "false" &&
window.siyuan.config.editor.codeLineWrap && block.parentElement.getAttribute("linewrap") !== "false") ||
(block.parentElement.getAttribute("lineNumber") === "true" && block.parentElement.getAttribute("linewrap") === "true")) {
lineNumberRender(block);
});
}
}
});
// 保持光标位置不变 https://ld246.com/article/1673704873983/comment/1673765814595#comments
if (!protyle.disabled && protyle.toolbar.range) {
let rangeRect = protyle.toolbar.range.getBoundingClientRect();