Skip to content

Commit

Permalink
🐛 fix #1356
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 14, 2023
1 parent 48b4cd9 commit 7588bfb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@

### v3.9.1 / 2023-03

* [代码块下一行的标题前输入中文时内容会跑到代码块里面](https://github.com/Vanessa219/vditor/issues/1356) `修复缺陷`
* [连续插入多个列表,控制台报错](https://github.com/Vanessa219/vditor/issues/1343) `修复缺陷`
* [IR 模式选择内容设置为代码块时异常](https://github.com/Vanessa219/vditor/issues/1354) `修复缺陷`

Expand Down
3 changes: 3 additions & 0 deletions src/ts/markdown/codeRender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {code160to32} from "../util/code160to32";
import {Constants} from "../constants";

export const codeRender = (element: HTMLElement) => {
element.querySelectorAll("pre > code").forEach((e: HTMLElement, index: number) => {
Expand Down Expand Up @@ -51,5 +52,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.

e.before(divElement);
e.style.maxHeight = (window.outerHeight - 40) + "px";
// https://github.com/Vanessa219/vditor/issues/1356
e.insertAdjacentHTML("afterend", `<span style="position: absolute">${Constants.ZWSP}</span>`)
});
};
1 change: 1 addition & 0 deletions src/ts/util/processCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const processCodeRender = (previewPanel: HTMLElement, vditor: IVditor) =>
}
const language = previewPanel.firstElementChild.className.replace("language-", "");
if (!language) {
codeRender(previewPanel);
return;
}
if (language === "abc") {
Expand Down

0 comments on commit 7588bfb

Please sign in to comment.