mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨 代码块出现滚动条时行号高度较矮
This commit is contained in:
parent
397907e151
commit
adecf247e0
1 changed files with 3 additions and 1 deletions
|
|
@ -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>`);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue