Skip to content

Commit

Permalink
fix: 修复插入代码异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wangqiaoling01 committed Apr 11, 2021
1 parent ee53439 commit b5fb553
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/menus/code/create-panel-conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default function (editor: Editor, text: string, languageType: string): Pa
selectCodeElem()
}

const content = editor.selection.getSelectionStartElem()?.elems[0].innerHTML
if (content) {
editor.cmd.do('insertHTML', EMPTY_P)
}
editor.cmd.do('insertHTML', text)

const $code = editor.selection.getSelectionStartElem()
Expand Down

0 comments on commit b5fb553

Please sign in to comment.