Skip to content

Commit

Permalink
fix #3270: CRLF not processed when pasting in code block
Browse files Browse the repository at this point in the history
  • Loading branch information
morecup committed May 23, 2022
1 parent 2bb405a commit 4b131dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/muya/lib/contentState/pasteCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const pasteCtrl = ContentState => {
const blockText = startBlock.text
const prePartText = blockText.substring(0, start.offset)
const postPartText = blockText.substring(end.offset)
startBlock.text = prePartText + text + postPartText
startBlock.text = prePartText + text.replace(/\r\n/g, '\n') + postPartText
const { key } = startBlock
const offset = start.offset + text.length
this.cursor = {
Expand Down

0 comments on commit 4b131dc

Please sign in to comment.