Who inserted the BR tag?
Tuesday, 30. December 2008, 12:50:43
Vacation. A good time to learn some web development. My goal is simple, build a word processor that works the way I would want it to work.
So, contenteditable. Documentation is sparse, but I have been looking at the HTML 5 specification. execCommand is not good enough for me, so I manipulate the DOM directly.
This surely exposes a lot of bugs in all browsers. (since this is not in any released specification yet, maybe I should not call it bugs, but at least the implementations are not logical)
I don't care about IE (using a MAC), and I do not really need to get it running in all the other browsers either, I just want a proof of concept.
I have been jumping between the browsers to be able to avoid the bugs, and currently I use Opera, since it is closest to get my code working.
However, Opera does something really strange in contenteditable. I remove all the text in the contenteditable control (with DOM tree manipulation). Then I try to insert a new character (again, with DOM tree manipulation). Suddenly, someone or something has inserted a br tag into my contenteditable div element. I have no br tags in my document, and since I do all the manipulations myself, and do not allow contenteditable to do the manipulations, it is really really strange that it ends up there. The workaround will be hard to find.
It is at least a fun project, even if I have to spend most of the time trying to find workarounds. Now I think I can understand how the life of a web developer is. (and I am not even trying to develop for IE)
So, contenteditable. Documentation is sparse, but I have been looking at the HTML 5 specification. execCommand is not good enough for me, so I manipulate the DOM directly.
This surely exposes a lot of bugs in all browsers. (since this is not in any released specification yet, maybe I should not call it bugs, but at least the implementations are not logical)
I don't care about IE (using a MAC), and I do not really need to get it running in all the other browsers either, I just want a proof of concept.
I have been jumping between the browsers to be able to avoid the bugs, and currently I use Opera, since it is closest to get my code working.
However, Opera does something really strange in contenteditable. I remove all the text in the contenteditable control (with DOM tree manipulation). Then I try to insert a new character (again, with DOM tree manipulation). Suddenly, someone or something has inserted a br tag into my contenteditable div element. I have no br tags in my document, and since I do all the manipulations myself, and do not allow contenteditable to do the manipulations, it is really really strange that it ends up there. The workaround will be hard to find.
It is at least a fun project, even if I have to spend most of the time trying to find workarounds. Now I think I can understand how the life of a web developer is. (and I am not even trying to develop for IE)








