Thanks, Joe, for responding.
I agree that the post-processing approach is too late. I am glad you
are writing a new approach which works with all the information at the
time of insertion or deletion.
Without a detailed understanding of the internal data structure, in
principle or in specific detail as Composer is running, and with View
HTML Source doing similar things as file save, it hard for me to debug
internal Composer happenings simply by looking at the files which are
saved.
You are right about:
> > Number of spaces: - = space
> > n = non-breaking space
> > 1 -
> > 2 -n
>
> It is supposed to be:
> 2 n-
> If it isn't that's a bug.
It *is* n-. My analysis was wrong.
Perhaps I have the "bug", but at present I am compiling a version with
the whitespace scheme I proposed, and line wrapping in the save file
department hopefully disabled. (I have set mMaxColumn to a large number
in line 376 of /layout/base/src/nsHTMLContentSerializer.cpp.)
This won't fix everything, but I will be interested to see how much it
does fix. (Its slow at present, using the 30 November source, any
changes to the above file upsets the make process on Linux and Win98 and
I have to start afresh since I can't figure out why.)
Fixing the wrap column to a very large number (e.g. wc = 66666) at line
6174 of /editor/base/nsHTMLEditor.cpp stops View HTML Source from
wrapping the text it shows on screen. Perhaps this would alter whatever
ways it changes the data, but I haven't tested this yet.
I imagine you are the only person equipped to re-engineer Composer's
editing behaviour to be rigorously correct. May the force be with you!
I am merely tinkering - primarily out of curiosity and because I have
long been annoyed by a bug or bugs in N4.x Composer which gobbled
spaces, added null characters and (in earlier versions) crashed when the
null was deleted. Those problems seemed to be directly related to
whitespace and wrapping of the lines of HTML when the file was saved.
Some of the apparent problems with file save and with data changes from
View HTML Source which I demonstrated in my "Simple tests reveal . . ."
post seem to be independent of editing and whitespace troubles. Perhaps
if these are eliminated, whitespace problems would be easier to see
clearly, but that is just my feeling since I can't see clearly into the
Lizard's brain.
- Robin