Skip to content

Commit

Permalink
粘贴多行代码时,避免代码段的 ``` 与当前行内容混淆在一起
Browse files Browse the repository at this point in the history
  • Loading branch information
zTreeAPI authored and Vanessa219 committed Jul 29, 2020
1 parent 1aae5b1 commit 9a9e101
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ts/util/fixBrowserBehavior.ts
Expand Up @@ -1292,6 +1292,11 @@ export const paste = (vditor: IVditor, event: ClipboardEvent & { target: HTMLEle
}
}
} else if (code) {
let codeFix = code;
if (/\n/.test(code)) {
// 粘贴多行代码时,避免代码段的 ``` 与当前行内容混淆在一起
codeFix = `\n${code}`;
}
callback.pasteCode(code);
} else {
if (textHTML.trim() !== "") {
Expand Down

0 comments on commit 9a9e101

Please sign in to comment.