fix: Misalignment of code block line numbers when font-size is increased in Edge
closes #5612
This commit is contained in:
@@ -1149,7 +1149,7 @@ mark {
|
||||
&:after {
|
||||
content: attr(data-line-numbers);
|
||||
position: absolute;
|
||||
padding-left: 1em;
|
||||
padding-left: 0.5em;
|
||||
left: 1px;
|
||||
top: calc(1px + 0.75em);
|
||||
width: calc(var(--line-number-gutter-width,0) * 1em + .25em);
|
||||
|
||||
@@ -121,14 +121,14 @@ function getDecorations({
|
||||
const lineCountText = new Array(lineCount)
|
||||
.fill(0)
|
||||
.map((_, i) => padStart(`${i + 1}`, gutterWidth, " "))
|
||||
.join(" \n");
|
||||
.join("\n");
|
||||
|
||||
lineDecorations.push(
|
||||
Decoration.node(
|
||||
block.pos,
|
||||
block.pos + block.node.nodeSize,
|
||||
{
|
||||
"data-line-numbers": `${lineCountText} `,
|
||||
"data-line-numbers": `${lineCountText}`,
|
||||
style: `--line-number-gutter-width: ${gutterWidth};`,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user