quilljs-markdown
quilljs-markdown copied to clipboard
Display error while paste multi `inlinecode`
Display error when i copy a multi inlinecode sentence like "- `Integer.MAX_VALUE` is `2147483647`, `Integer.MAX_VALUE / 10` is `214748364`. something else...." , and paste on editor directly.
seems like this error is cause by code added in #38
if (format['code-block'] || format['code']) {
// if exists text in code-block, to skip.
if (format['code']) {
// ignore all styles when copied text in code block.
const copiedTexts = delta.ops.filter(d => d.insert).map(d => d.insert).join('')
this.quillJS.deleteText(retain, copiedTexts.length)
this.quillJS.insertText(retain, copiedTexts.replace(/\n/g, ''), { code: true })
this.quillJS.format('code', false)
}
return false
}
this code will be executed and remove all the text you pasted, then insert the whole raw text into code block
ScreenShot: