2 ms·
content-editable is a crap shoot without some JS layer on top of it normalized the output. Otherwise you end up with the same visual output being able to define
by charrondev 3y ago
content-editable is a crap shoot without some JS layer on top of it normalized the output. Otherwise you end up with the same visual output being able to defined as 50 different inputs.
The other thing is content editable allows all kinds of garbage to be pasted into it included any kind of inline style.
Now I maintain a fork of Htmlawed which can do a pretty decent job of filtering down arbitrary HTML into a safe and restricted subset but with no JS there can be a huge disconnect between what the user sees in their editor and what appears as the sanitized output.
As a result I’m currently using SlateJS as a rich text editor foundation. I’ve used others in the past but this is the nicest so far.