Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/11274

Vanessad5038ac5be69
diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts
index c7678238bb..f5184e1e35 100644
--- a/app/src/protyle/util/resize.ts
+++ b/app/src/protyle/util/resize.ts
@@ -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();