Re:Innovative Rich Text Editing: Typing Affinity
by stabbles on Sunday November 06, 2022 @04:42AM
(#33490819)
I guess it won't work for rich editors that create tons of elements for every style applied, like `<b><span style=font:...><span style=...>...<i>...` it requires some sanity of the editor.
[ Parent
| on HN ]
Re:Innovative Rich Text Editing: Typing Affinity
by samwillis on Sunday November 06, 2022 @04:45AM
(#33490843)
Older content editable editors would do that. But modern ones have moved to not nesting inline styles, and separating internal data structure from the exported html. Full html isn't really that great for the internal data structure of a rich text editor.
Think of them as having only a none nestable <span> tag with a style attribute.
Re:Innovative Rich Text Editing: Typing Affinity
by oneeyedpigeon on Sunday November 06, 2022 @05:12AM
(#33491020)
I'm hoping these modern editors you refer to at least replace those <span...> atrocities with the correct elements on save.
Re:Innovative Rich Text Editing: Typing Affinity
by samwillis on Sunday November 06, 2022 @05:15AM
(#33491043)
They do, they separate the internal representation of the editor state from the saved html.
Re:Innovative Rich Text Editing: Typing Affinity
by jessegrosjean on Sunday November 06, 2022 @08:40AM
(#33492516)
I don't think it would matter, text affinity happens at texts "run" boundaries... so only where formatting changes. Doesn't matter how many attributes each run has. I think that is proper way to design the feature, but it does means it's maybe less flexible then you are thinking. You can pick left or right run... you can pick individual attributes within a run with text affinity.