4 ms·
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 require
by stabbles 4y ago
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.
- samwillis 4y agoOlder 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.
- oneeyedpigeon 4y agoI'm hoping these modern editors you refer to at least replace those <span...> atrocities with the correct elements on save.
- samwillis 4y agoThey do, they separate the internal representation of the editor state from the saved html.
- jessegrosjean 4y agoI 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.