ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
24.69k stars 2.06k forks source link

[Bug]: attrs json object in heading does not have Object prototype #4697

Open emil14 opened 6 months ago

emil14 commented 6 months ago

Which packages did you experience the bug in?

tiptap-core

What Tiptap version are you using?

2.1.13

What’s the bug you are facing?

Looks like attrs object (e.g. {level: 1} in my case) does not have Object as it's prototype and as a result calling attrs.hasOwnProperty will throw exception.

Can't you just do something like Object.prototype.hasOwnProperty(attrs, 'level') you may ask? No, I'm not the one who do it. I use a library rxdb and

I created an issue in their repo but I think this should be fixed on both sides. There could be many more such cases.

This issue is critical for my app so if they won't fix it it would be awesome if you will. Please help. Thank u!

https://github.com/pubkey/rxdb/issues/5382

What browser are you using?

Chrome

Code example

No response

What did you expect to happen?

I expect call to hasOwnProperty do not throw

Anything to add? (optional)

No response

Did you update your dependencies?

Are you sponsoring us?

bbss commented 2 months ago

Also hit attrs not having a prototype, it breaks serialization of docs in my project.