User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:220.127.116.11) Gecko/20080201 Firefox/18.104.22.168
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20080201 Firefox/126.96.36.199
The reason is that every automatic change that goes through the execCommand interface results in one step in the undo/redo history while any automatic change through DOM manipulation completely erases that history. Both options are not acceptable for the user.
This is currently a major hurdle in the development of many rich text editors (including the Wikipedia editor wikEd http://en.wikipedia.org/wiki/User:Cacycle/wikEd).
I am not familiar with Midas implementation details but one possible solution might be:
- Automatic changes are usually submitted after automatic highlighting (setting a range) followed by a inserthtml command. The undo/redo function merges manual text changes that do not involve caret movements. It might be possible to merge all inserthtml changes that do not involve plain text changes with the current undo step.
- Alternatively, a new option (or even a new command) could be added to force such a redo merge
It would be great if we could discuss ways to fix this in this thread and could come up with a solution.
This is a problem and a major barrier for wikEd, which is used on many various wikis in order to improve their user's experience. Rich text editors for things like blogs are also exist and this bug interferes with them as well.
Yes, if you fix this, you can really help out wikipedia.
Do other browsers do better here? If so, how? If not, it seems like changing our behavior might pose compatibility problems, and a better forum for developing a solution might be the WHATWG list.
The others do not do better as far as I know.
I agree that the introduction of new options and commands should finally be discussed and decided by WHATWG or another standardizing instance. However, it would not hurt to brainstorm some possible solutions here first with people that know more about the actual details of the Midas implementation.
Some of the possible solutions (or at least temporary fixes) proposed above lay at the discretion of of the browser implementations and it is hard to imagine how the fine tuning of the undo/redo functionality could introduce unwanted browser incompatibilities.
I know very little about the programing end of things but I do know that as a Wikipedia editor, the project WikEd that Cacycle is working on is the best thing since sliced bread. Such text editors are the future for Wiki projects.