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

InputRules does not work for ranges containing multiple text nodes. #3071

Closed
1 of 2 tasks
hamflx opened this issue Aug 10, 2022 · 1 comment · Fixed by #3205
Closed
1 of 2 tasks

InputRules does not work for ranges containing multiple text nodes. #3071

hamflx opened this issue Aug 10, 2022 · 1 comment · Fixed by #3205
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@hamflx
Copy link
Contributor

hamflx commented Aug 10, 2022

What’s the bug you are facing?

When markdown tags cover multiple text nodes, they will not work. See GIF:

动画

The initial problem was #2937, fixed by #2941.

But if a paragraph contains multiple text nodes within it, and InputRule needs to span those nodes, it will not work.

I'm using the latest code from the main branch.

Which browser was this experienced in? Are any special extensions installed?

Chrome/103.0.0.0. No special extensions.

How can we reproduce the bug on our side?

  1. type 'A B C'
  2. make 'B' bold
  3. type '*' at the begining
  4. type '*' at the end

correct result: A B C
incorrect result: *A B C*

Can you provide a CodeSandbox?

No CodeSandbox, but there is a "Deploy Preview" provided by #2941

https://deploy-preview-2941--tiptap-embed.netlify.app/

What did you expect to happen?

InputRule should work between multiple text nodes.

Anything to add? (optional)

No response

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. 💖
@hamflx hamflx added the Type: Bug The issue or pullrequest is related to a bug label Aug 10, 2022
@hamflx hamflx changed the title InputRules does not work for ranges contianing multiple text nodes. InputRules does not work for ranges containing multiple text nodes. Aug 10, 2022
@revidee
Copy link

revidee commented Sep 19, 2022

Also faced this issue in our installment of tiptap, dug deep and found the exact same broken LOCs as you did. Your fix seems very reasonable and should be pulled in the near future IMHO.

bdbch pushed a commit that referenced this issue Sep 29, 2022
…xt nodes (#3205)

* fix: InputRules does not work for ranges containing multiple text nodes. #3071

* chore: rename `to` to `sliceEndPos`
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

Successfully merging a pull request may close this issue.

3 participants