-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Editor inserts empty paragraph before and after custom node #2560
Comments
Seeing this as well, with:
|
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. |
Any news on this one? Seems to be an issue to at least 9 other devs as well. |
Have the same issue, no I manually deleting those 2 paragraphs right after insertion of my custom element. It's works well but default behavior is not expected |
is anyone has solution? |
Same issue here with the youtube plugin |
The problem still persists. I think as the stale bot closed it the tiptap team doesn't notice anything here, right? |
@kaiserkiwi maybe you could open open up a new issue and copy this in? Like you say, I believe the team might not see this :) |
I'm facing the same issue with taskItems (lists) |
We're also facing this issue when inserting HTML using the api |
The issue still persists |
Same issue! |
I faced with this problem too. |
In my case, the issue was only occuring when I was pasting a value that was triggering that component to be displayed. In the Node, I had the following: addPasteRules () {
return [
new PasteRule({
find: VIDEO_REGEX_GLOBAL,
handler: (state) => handleRule.call(this, state)
})
]
}, and the state.tr.replaceWith(
range.from,
range.to,
this.type.create({ src: getEmbededUrl(url) })
) The issue was with the Hope that helps :) |
What’s the bug you are facing?
I have a custom node, with a
renderHTML()
function which looks like this:Everything with my custom node works just fine but one thing, namely, before and after each 'figure'-node that is inserted, there is a p-Tag rendered as such, with a line break inside:
In the end, the full HTML for my node, after having inserted it, would be:
Upon content update, tiptap deletes the line break inside the paragraph, but the paragraph itself remains. In the end, every time I update something, the number of empty tags would accumulate and become very numerous. Naturally I can just filter out empty p-tags every time the editor loads, but that's a dirty approach from my side.
Any idea on why these empy paragraphs might show up in the first place?
How can we reproduce the bug on our side?
Did not manage to create a working sandbox in codesandbox.
In Codesandbox, I here get an error that I do not get locally, with the same versions of the dependencies.
error in mounted hook: SyntaxError mixing inline and block content
Can you provide a CodeSandbox?
No response
What did you expect to happen?
I expected my custom node to be inserted without empty p-Tags before and after.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: