Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/5612

Vanessa3d8208f25b04
diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index 6e19c7c931..99481b2e6a 100644
--- a/app/src/protyle/ui/initUI.ts
+++ b/app/src/protyle/ui/initUI.ts
@@ -96,9 +96,11 @@ export const setPadding = (protyle: IProtyle) => {
}
}
if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) {
- protyle.wysiwyg.element.querySelectorAll('.code-block [contenteditable="true"]').forEach((block: HTMLElement) => {
- lineNumberRender(block);
- });
+ setTimeout(() => { // https://github.com/siyuan-note/siyuan/issues/5612
+ protyle.wysiwyg.element.querySelectorAll('.code-block [contenteditable="true"]').forEach((block: HTMLElement) => {
+ lineNumberRender(block);
+ });
+ }, 300);
}
if (window.siyuan.config.editor.displayBookmarkIcon) {
const editorAttrElement = document.getElementById("editorAttr");