Browse Source

:bug: https://github.com/Vanessa219/vditor/issues/1786

Vanessa 6 months ago
parent
commit
8c05bca990
3 changed files with 3 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      src/assets/less/_reset.less
  3. 1 1
      src/js/highlight.js/styles/ant-design.min.css

+ 1 - 0
CHANGELOG.md

@@ -25,6 +25,7 @@
 
 ### v3.11.0 / 2025-04
 
+* [修复代码行号对不齐](https://github.com/Vanessa219/vditor/issues/1786) `修复缺陷`
 * [mermaid 升级至 11.6.0](https://github.com/Vanessa219/vditor/issues/1140) `开发重构`
 * [初始化后立即 `destroy` 不再进行 `after` 的回调](https://github.com/Vanessa219/vditor/issues/1790) `改进功能`
 * [点击复制按钮不展开编辑区域](https://github.com/Vanessa219/vditor/issues/1768) `改进功能`

+ 1 - 1
src/assets/less/_reset.less

@@ -365,7 +365,7 @@
         &__rows {
             position: absolute;
             pointer-events: none;
-            top: 0.5em;
+            top: 1em;
             left: 0;
             width: 3em; /* works for line-numbers below 1000 lines */
             user-select: none;

+ 1 - 1
src/js/highlight.js/styles/ant-design.min.css

@@ -1,6 +1,6 @@
 .hljs {
     display: block;
-    padding: 16px 32px;
+    padding: 1em;
     overflow-x: auto;
     color: rgba(0, 0, 0, .85);
     border-radius: 2px;