From f476fd272e6e9c8eb4ceaff745045871b9cc0a5b Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 24 Jun 2022 11:47:43 +0800 Subject: [PATCH] :art: add hljs by lute --- app/src/protyle/markdown/highlightRender.ts | 1 - app/src/protyle/util/onGet.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/protyle/markdown/highlightRender.ts b/app/src/protyle/markdown/highlightRender.ts index bf70a8a49..a957d57f5 100644 --- a/app/src/protyle/markdown/highlightRender.ts +++ b/app/src/protyle/markdown/highlightRender.ts @@ -63,7 +63,6 @@ export const highlightRender = (element: Element, cdn = Constants.PROTYLE_CDN) = if (!hljs.getLanguage(language)) { language = "plaintext"; } - block.classList.add("hljs"); block.innerHTML = hljs.highlight( block.textContent + (block.textContent.endsWith("\n") ? "" : "\n"), // https://github.com/siyuan-note/siyuan/issues/4609 { diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 33b332a74..49cf08ce7 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -129,7 +129,7 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt protyle.contentElement.scrollTop = protyle.contentElement.scrollTop + (lastElement.getBoundingClientRect().top - lastTop); // 动态加载移除 while (protyle.wysiwyg.element.childElementCount > 2 && protyle.contentElement.scrollHeight > REMOVED_OVER_HEIGHT && - protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().bottom > window.innerHeight) { + protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().top > window.innerHeight) { protyle.wysiwyg.element.lastElementChild.remove(); } } else {