You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've read that "document.execCommand" outputs different HTML in different browsers. This is not very good if we're to build a content-editing app that users use and switch across different browsers. Once they open the app in another browser, and try to edit the contents created in another browser, some browsers will probably not respond correctly.
I didn't test the html output in all browsers myself, so I'm not sure whether a normalization system is included in Etch.js, is there? If not, are there any ideas how to tackle this situtation?
Thanks
The text was updated successfully, but these errors were encountered:
The problem is that browsers simply do it differently and have for a long time. Also I don't know of any real efforts on their parts to remedy the situation. The API's for contentEditable are pretty opaque and don't offer much in the way of customization of the output. The only way I can think of the have complete normalization between browsers would be to abandon using the API and roll our own. That would be A LOT of tricky code that would need a lot of cross-browser shimming since the selection API's are different in the browsers as well. I feel like the best thing to do is to be ok with some differences and keep the codebase lightweight. If someone wanted to rewrite all the contentEditable operations I would consider abstracting the calls in etch to make it possible to use a plugin like that, but it isn't something that I feel driven to do myself. I'm not even sure it is 100% possible. Its a tough problem and you aren't the first person to ask. In my own projects I have encouraged users to use the same browsers for best results. Seemed to work pretty well.
Hello,
I've read that "document.execCommand" outputs different HTML in different browsers. This is not very good if we're to build a content-editing app that users use and switch across different browsers. Once they open the app in another browser, and try to edit the contents created in another browser, some browsers will probably not respond correctly.
http://www.quirksmode.org/dom/execCommand.html
"For instance, when making a selection bold, IE and Opera add a tag, while Mozilla adds a ."
I didn't test the html output in all browsers myself, so I'm not sure whether a normalization system is included in Etch.js, is there? If not, are there any ideas how to tackle this situtation?
Thanks
The text was updated successfully, but these errors were encountered: