HTML Input field
Hi.
I meed am input field to let the user enter an HTML table, to design the headers of a document template, so all content has the same header. RichEditor cant handle this. Is it safe or not to allow the user to enter HTML code? Any recommendations?
Solution:Jump to solution
Both of these support tables, I’m sure there’s a few more too. In general though it is risky to allow direct html. You have to make sure it’s getting sanitized properly.
https://filamentphp.com/plugins/mohamedsabil83-tinyeditor
https://filamentphp.com/plugins/awcodes-tiptap-editor...
10 Replies
Solution
Both of these support tables, I’m sure there’s a few more too. In general though it is risky to allow direct html. You have to make sure it’s getting sanitized properly.
https://filamentphp.com/plugins/mohamedsabil83-tinyeditor
https://filamentphp.com/plugins/awcodes-tiptap-editor
Ok! I'll make the configuration available only to me... as an Admin... (Y)
what ever you need to do 🙂
It seams Tiptap has a bug.
I enter code
<p style="text-align: center;"><h1>Title</h1></p>
save it, then enter code again and code is modified
<p style="text-align: center;; text-align: center"></p><h1>Title</h1>
It repeats text-align
Another example...
<h1 style="text-align: center;">Title</h1>
Is trasnformed in
<h1 style="text-align: center;; text-align: center; text-align: center; text-align: center">Title</h1>
I believe there is a known bug in the underlying Tiptap package around this.
Feel free to file an issue on the repo though and I can investigate further.
Sorry.... I've never summit a PR, or a bug, I'm a "lone wolf" coder, never worked in a team... I'll learn how to summit a PR
Doesn’t have to be a PR unless you have a fix. A simple Issue is enough.
Just file the issue here https://github.com/awcodes/filament-tiptap-editor
GitHub
GitHub - awcodes/filament-tiptap-editor: A Rich Text Editor plugin ...
A Rich Text Editor plugin for Filament Forms. Contribute to awcodes/filament-tiptap-editor development by creating an account on GitHub.
Done!
Thank you.