Re: Meaning and use of TIDY_STORE_ORIGINAL_TEXT

"Geoff Air" <[email protected]> Sat, 07 Jan 2006 14:05:08 +1100
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
Hi Björn,

Thank you for your quick reply. I thought, after
I sent the last post, he is probably the 'author'
of the code, since only the author should be
allowed to say disparaging things about his/her own
code ;=)) and call it 'ugly', 'messy' and 'buggy' ...

Yes, it is true, MACROS that contain a compiler
switch do look a little 'ugly' since the whole macro
needs to be repeated ... why the compiler pre-processor
could not take this into account I will never understand,
but you CAN terminate the macro statement with a ';', if
you want ... as far as I know most compilers allow this ...
that is, will not cough at if(a){ do this; }; ...

While, as you state, you may never have intended it
be used in the default parser loop, it is in there, and
it largely works, and my small patches just finish off
some of that ... without harm to other code ...

As stated, I find it INVALUABLE in a DEBUG sense ... I
have added a 'very verbal' switch, that outputs the text
that the parser/lexer are currently handling ... it is a
great AID to visually SEE what the parser is presently
looking at ... then watch how it handles it ... my first
post showed some of its voluminous output ...

Thank you for clarifying, and giving a link, to the CVS
tree ... but I think that 'tree' is what is updated, when
I do my regular 'cvs up -dP' to my local tidy (cvs) folder ...
so I have all that ... do I not? ... why would browsing
this CVS tree online give me more?

I have some good search tools, grep-like, to find every
reference to TIDY_STORE_ORIGINAL_TEXT, and I have done
that ... it is only mentioned in some 2 'src' files, and
a few headers ...

Par contra, I can find your name in -
htmldoc\Overview.html, and htmldoc\release-notes.html,
as a contributor, and as the cvs updater of such files
as src\charsets.h, src\entities.h, src\tidy-int.h; and
in the not yet included files such as src\iconvtc.[c|h] -
TIDY_ICONV_SUPPORT; changes in src\parser.c
and src\win32tc.h - TIDY_WIN32_MLANG_SUPPORT, and
in 2 xml test/input files, etc ...

But it seems nowhere is it documented that you were
the author of TIDY_STORE_ORIGINAL_TEXT code, nor when it
was included, and there appears no documentation of its
original purpose ... but that is NOT so important now ;=))

I have FOUND a very good DEBUG purpose, and USE IT ...
why not 'agree' to add my small 'fixes', and allow me
to continue to use it for this purpose? Other developers
may also 'like' this use, now that more is documented
about it ... and it is getting 'fixed' ...

In this regard, if others are interested, I have developed
a tidylog.[c|h] module that writes the tidy_out(...)
stream to a disk file, whether 'quiet' is on or not ...
I like to be able to refer back to ALL the output after
Tidy has run ... this is all under an ADD_VERB switch ...

I have some functions in there, like show_node(...),
which I can drop into the code anywhere, and get more
information about the 'element', or 'node' being
processed ... it is quite 'messy' and ONLY for
programmers ... but more could be added ...

Yes, some of this can also be done by console 'redirection',
but it is not very 'convenient' to do that from within
the MSVC IDE debugger, and you get nothing if 'quiet' is
on ... and when the debugger exits, the console it created
to run the application is closed ... hence my persistent
templog.txt file ...

Whether I, or anyone else 'finds' ANOTHER use for your
TIDY_STORE_ORIGINAL_TEXT code remains to be seen ... but
can I add, it is reasonably good code, and does not contain
as many 'subtle' bugs as you, the author, seem to think ...
you do seem to have taken into account most of the parser,
lexer, sometimes VERY torturous, paths ;=))

I have mentioned that it does seem to 'miss' some line
endings in certain circumstance, and I have not yet tested
it fully with 'scripts', like <?, embedded in the HTML ...
and especially with 'double-byte' languages ... chinese,
hangul, kanji, etc, which links to multiple language
support ... character encodings ... something I think is
of growing importance ...

In fact I have marked many of the CondReturnTextNode macros
in my development code with /* ***TBC*** */ (To Be Checked)
just to remind me to check these ... but I am sure all of
these problems can be 'fixed', if they exist ...

And yes, I too would be interested in what other think
about this VERY CONDITIONAL (programmer ONLY, at this stage)
feature ... and its possible uses, now that it is in
there ... thank you for this ... and it is getting a good
'workout' ;=))

Kind regards,

Geoff.

EOF - Tidy-10.doc

_________________________________________________________________
New year, new job – there's more than 100,00 jobs at SEEK 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau&_t=752315885&_r=Jan05_tagline&_m=EXT



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click