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

HorizontalRule extension: inconsistent behavior #1964

Closed
2 tasks done
cadars opened this issue Oct 1, 2021 · 3 comments · Fixed by #4289
Closed
2 tasks done

HorizontalRule extension: inconsistent behavior #1964

cadars opened this issue Oct 1, 2021 · 3 comments · Fixed by #4289
Assignees
Labels
Type: Bug The issue or pullrequest is related to a bug
Milestone

Comments

@cadars
Copy link
Contributor

cadars commented Oct 1, 2021

What’s the bug you are facing?

Inserting an HorizontalRule produces different results depending on:

  • How is it created, shortcut or command
  • Where in the document it is created; first, last, or in between nodes
  • The presence of the StarterKit extensions (maybe because of GapCursor?)

How can we reproduce the bug on our side?

With just the HorizontalRule extension: https://embed.tiptap.dev/preview/Nodes/HorizontalRule

  • Type --- or ___ or ***, an empty <p> is created before the node.

With the StarterKit extensions: https://embed.tiptap.dev/preview/Examples/Default

  • Type --- or ___ or ***, an empty <p> is created before the node.

  • Empty the editor, click horizontal rule, this markup gets created:

    <hr contenteditable="false">
    <p><br></p>
    <p><br><br></p>

( I am using the tiptap.dev examples but I also can reproduce these issues locally, with all dependencies updated)

Can you provide a CodeSandbox?

No response

What did you expect to happen?

  • Adding an horizontal rule with markdown shortcuts should not add any empty paragraphs before it.
  • Adding an horizontal rule as the first node with the setHorizontalRule command should not add more than one empty paragraph after it.

Anything to add? (optional)

As always, thanks for your time, and this amazing editor!

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. 💖
@cadars cadars added the Type: Bug The issue or pullrequest is related to a bug label Oct 1, 2021
@rfgamaral
Copy link
Contributor

I came looking for this issue, and I just want to add a few things:

Adding an horizontal rule with markdown shortcuts should not add any empty paragraphs before it.

This still happens, even after @philippkuehn commit above, and I agree that it shouldn't.

What did you expect to happen?

IMO, an empty paragraph should be added after adding the horizontal rule with the Markdown shortcut, if it's the last node being inserted in the document, so that the cursor is placed after the horizontal rule, and the user can continue typing.


@cadars I'm wondering if you ended up working on a fixed version of this extension on your side? If so, do you think you could share that?

@stale
Copy link

stale bot commented Jul 6, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 6, 2022
@stale stale bot closed this as completed Jul 14, 2022
@rfgamaral rfgamaral mentioned this issue Sep 15, 2022
10 tasks
@bdbch bdbch reopened this Sep 15, 2022
@bdbch bdbch added this to the 2.0.0 milestone Sep 15, 2022
@autumninflab
Copy link

@bdbch
Hi, :)
Is this issue will fix soon?
I have similar issue.

  1. typing ---, a horizontal rule created.
  2. typing any character (without line break)
  3. horizontal rule is disappeared.

I guess it's because cursor still on the horizontal rule.
so the cursor should place after horizontal rule.

2022-09-15.9.22.16.mov
2022-09-15.9.24.18.mov

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
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants