mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 add hljs by lute
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user