awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
272 stars 73 forks source link

Code inside <code> disappears after save & refresh in editor when using HTML output #444

Closed DanielSpravtsev closed 1 day ago

DanielSpravtsev commented 1 month ago

Filament Version

v3.2.98

Plugin Version

3.4.8

PHP Version

8.3.1

Problem description

Code inside code blocks wipes out to first word when using default HTML output after save and refresh in filament resource create When using JSON output everything is ok, so I think there are some issues in code blocks formatting, maybe coming from tiptap dependency itself

2024-08-12_12-13-44 After save & refresh: 2024-08-12_12-14-11

Expected behavior

Code should not disappear

Steps to reproduce

Create new resource record Paste code block to editor Press save Refresh page Code will wiped to the first starting word

Reproduction repository

No response

Relevant log output

No response

awcodes commented 1 month ago

Thinking this could be related: https://github.com/awcodes/filament-tiptap-editor/issues/384

DanielSpravtsev commented 1 month ago

Thinking this could be related: https://github.com/awcodes/filament-tiptap-editor/issues/384

This could fix it

1.4.0 https://github.com/ueberdosis/tiptap-php/releases

awcodes commented 1 month ago

Nice, was waiting on a update from them. Will look into bumping it soon. You should be able to bump it in your project though without having to wait on me.

awcodes commented 1 month ago

Looks like the problem still isn't solved. But I'm unable to replicate your exact issue. I'll do some more digging.

0ankitcodes1 commented 3 weeks ago

I have also encountered this vanishing code problem but my one looks like this.

https://github.com/user-attachments/assets/52aa8487-018d-4256-a6c5-ffe7052dc5ef

Here I have created a custom block. If I add some other element infront of custom block everything works. But if my code start with that custom block followed by regualre element when I try to clear the regular element only the block disappears.

0ankitcodes1 commented 3 weeks ago

And some times if I save only the custom block in the field. It disappears when I save and come back to see it again.

awcodes commented 3 weeks ago

Yea. There's something odd going on with custom nodes as the first element of the schema. Unfortunately, I have been able yet to track down if it's an issue with Tiptap itself or the plugin.

fabianpimminger commented 1 week ago

@awcodes Unfortunately I'm having the same issue. Any idea whats wrong here?

awcodes commented 1 week ago

No update yet. Sorry.

awcodes commented 2 days ago

Possibly resolved with v3.4.14. Let me know.

fabianpimminger commented 1 day ago

@awcodes it's working in 3.4.14! Thank you very much!