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

Pasting rules are broken after update to 2.0.0-beta.119 #2002

Closed
1 of 2 tasks
nokola opened this issue Oct 8, 2021 · 1 comment
Closed
1 of 2 tasks

Pasting rules are broken after update to 2.0.0-beta.119 #2002

nokola opened this issue Oct 8, 2021 · 1 comment
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@nokola
Copy link
Contributor

nokola commented Oct 8, 2021

What’s the bug you are facing?

Pasting things like **bold** or *italic* multiple times doesn't work anymore.

How can we reproduce the bug on our side?

https://codesandbox.io/s/tiptap-after-paste-bug-jjoxc

  1. Create editor:
mounted() {
    this.editor = new Editor({
      extensions: [StarterKit],
      content: `
        <p>hello</p>
      `,
    });
  },
  1. Paste this twice (Ctrl+V):
**bold**
*italic*

Expected: bold and italic show OK
Actual: second paste shows this:
image
The bold and italic have their * marks showing

  1. Press enter 2-3 times
  2. Paste again
  3. Press enter
    Expected: bold and italic show up
    Actual: some data is lost - the "italic" text becomes "talic"

image

Can you provide a CodeSandbox?

https://codesandbox.io/s/tiptap-after-paste-bug-jjoxc

What did you expect to happen?

Bold and italic to show up formatted

Anything to add? (optional)

This might be some side effect of updating text after paste. A lot of my custom plugins are broken - I have a [[date]] and [[toc]] plugins for table of contents. most of these are lost on paste. For example, pasting this long text loses most of the info:

testcases:

aaa|bbb

test

test
xyz

test *bold*
xyz

test *bold*[[date]]
xyz

[[date]]

[[date]]
Y[[date]]x

Z[[date]]
Y[[date]]x


[[date]]
[[date]]

before
at[[date]]xxx
[[date]]
after

image

Used to work great before the pasterule/input rule updates.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@nokola nokola added the Type: Bug The issue or pullrequest is related to a bug label Oct 8, 2021
@nokola
Copy link
Contributor Author

nokola commented Oct 8, 2021

For people who are hitting the same issue, here's a temporary way to go to older plug-in versions. Add this to package.json then npm i again

    "@tiptap/core": "2.0.0-beta.118",
    "@tiptap/extension-blockquote": "2.0.0-beta.15",
    "@tiptap/extension-bold": "2.0.0-beta.15",
    "@tiptap/extension-bullet-list": "2.0.0-beta.15",
    "@tiptap/extension-code": "2.0.0-beta.16",
    "@tiptap/extension-code-block": "2.0.0-beta.18",
    "@tiptap/extension-collaboration": "2.0.0-beta.22",
    "@tiptap/extension-collaboration-cursor": "2.0.0-beta.22",
    "@tiptap/extension-dropcursor": "2.0.0-beta.18",
    "@tiptap/extension-gapcursor": "2.0.0-beta.24",
    "@tiptap/extension-hard-break": "2.0.0-beta.21",
    "@tiptap/extension-heading": "2.0.0-beta.15",
    "@tiptap/extension-highlight": "2.0.0-beta.21",
    "@tiptap/extension-horizontal-rule": "2.0.0-beta.21",
    "@tiptap/extension-image": "2.0.0-beta.15",
    "@tiptap/extension-italic": "2.0.0-beta.15",
    "@tiptap/extension-link": "2.0.0-beta.20",
    "@tiptap/extension-list-item": "2.0.0-beta.14",
    "@tiptap/extension-ordered-list": "2.0.0-beta.16",
    "@tiptap/extension-strike": "2.0.0-beta.17",
    "@tiptap/extension-task-item": "2.0.0-beta.18",
    "@tiptap/extension-task-list": "2.0.0-beta.17",
    "@tiptap/extension-typography": "2.0.0-beta.14",
    "@tiptap/starter-kit": "2.0.0-beta.117",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant