Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display error while paste multi inlinecode #76

Open
Whyjsee opened this issue Jan 2, 2024 · 0 comments
Open

Display error while paste multi inlinecode #76

Whyjsee opened this issue Jan 2, 2024 · 0 comments

Comments

@Whyjsee
Copy link

Whyjsee commented Jan 2, 2024

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:
Screenshot 2024-01-02 at 15 21 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant