mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 代码块出现滚动条时行号高度较矮
This commit is contained in:
@@ -159,9 +159,11 @@ export const lineNumberRender = (block: HTMLElement) => {
|
||||
});
|
||||
|
||||
lineNumberTemp.remove();
|
||||
const height = block.offsetHeight;
|
||||
if (block.nextElementSibling?.classList.contains("protyle-linenumber__rows")) {
|
||||
block.nextElementSibling.innerHTML = lineNumberHTML;
|
||||
(block.nextElementSibling as HTMLElement).style.height = height + "px";
|
||||
} else {
|
||||
block.insertAdjacentHTML("afterend", `<span contenteditable="false" class="protyle-linenumber__rows">${lineNumberHTML}</span>`);
|
||||
block.insertAdjacentHTML("afterend", `<span contenteditable="false" style="height:${height}px" class="protyle-linenumber__rows">${lineNumberHTML}</span>`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user