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 {
|
&:after {
|
||||||
content: attr(data-line-numbers);
|
content: attr(data-line-numbers);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding-left: 1em;
|
padding-left: 0.5em;
|
||||||
left: 1px;
|
left: 1px;
|
||||||
top: calc(1px + 0.75em);
|
top: calc(1px + 0.75em);
|
||||||
width: calc(var(--line-number-gutter-width,0) * 1em + .25em);
|
width: calc(var(--line-number-gutter-width,0) * 1em + .25em);
|
||||||
|
|||||||
@@ -121,14 +121,14 @@ function getDecorations({
|
|||||||
const lineCountText = new Array(lineCount)
|
const lineCountText = new Array(lineCount)
|
||||||
.fill(0)
|
.fill(0)
|
||||||
.map((_, i) => padStart(`${i + 1}`, gutterWidth, " "))
|
.map((_, i) => padStart(`${i + 1}`, gutterWidth, " "))
|
||||||
.join(" \n");
|
.join("\n");
|
||||||
|
|
||||||
lineDecorations.push(
|
lineDecorations.push(
|
||||||
Decoration.node(
|
Decoration.node(
|
||||||
block.pos,
|
block.pos,
|
||||||
block.pos + block.node.nodeSize,
|
block.pos + block.node.nodeSize,
|
||||||
{
|
{
|
||||||
"data-line-numbers": `${lineCountText} `,
|
"data-line-numbers": `${lineCountText}`,
|
||||||
style: `--line-number-gutter-width: ${gutterWidth};`,
|
style: `--line-number-gutter-width: ${gutterWidth};`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user