|
|
Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: Strip NOLAYER and everything inside? (urgent) - msg#00027
List: web.html-tidy.user
Hello, list!
I urgently need a workaround to make TIDY strip everything it finds if
it is enclosed by <nolayer> tags.
The reason is that some editors (ab)use it to hide old stuff from the
browsers and I was asked to make it strip that stuff automagically:
<nolayer>
<style id="NOF_STYLE_SHEET">
<!--
-->
</style>
</nolayer>
Currently tidy strips out <nolayer> and places
<style id="NOF_STYLE_SHEET">
<!--
-->
</style>
to the head of the document.
I am trying to recompile it placing DiscardElement(doc, element);
calls in ParseScript but that is obviousely not the beast idea since
it does not work correctly.
Very grateful for your help,
--
Sincerely yours,
Yury V. Zaytsev
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Tidy UI, TidyLib, & HTML Reference Library
I just discovered the Help/About in Tidy UI and it gives a different author and a web site link (Charles Reitzel, http://tidy.sourceforge.net), but uses the old HTML Tidy logo. I went to the website and while my original question went unanswered, I did learn that Tidy UI is the latest version of Dave Raggett?s legacy.
The site features TidyLib, but it isn?t clear. It starts out as if it will explain what the program does, but mostly it seems to go on and on about its developement and how to continue work on its developement. Is TidyLib supposed to be simular to HTMLib by Steve LeHunte? I have been trying to find a current version of that program also. I use both programs from within my text editor, Boxer, to create and edit my HTML web pages. HTMLib is called as context-sensitive help.
I finally accessed the help file for Tidy UI which is available only when the user is online. I do not have 24/7 access to the internet and when I do there are times when I am not online. It would be helpful to have Tidy access a Help.HTML file in the directory on the hard drive where it is located.
Rod
----- Original Message ----- From: "Bjoern Hoehrmann" To: "Rod Lockwood" Subject: Re: HTML Tidy Date: Wed, 17 Aug 2005 17:53:20 +0200 * Rod Lockwood wrote: > In TidyGUI a warning states: > Characters codes for the Microsoft Windows fonts in the range > 128 - 159 may not be recognized on other platforms. You are > instead recommended to use named entities, e.g. ? rather > than Windows character code 153 (0x2122 in Unicode). > > So how do I get Tidy to convert the character codes into the named > entities? I would have thought you would have fixed that in Tidy UI. HTML Tidy does that automatically. -- Björn Höhrmann · mailto:bjoern@xxxxxxxxxxxx · http://bjoern.hoehrmann.de Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
--
_______________________________________________
Search for businesses by name, location, or phone number. -Lycos Yellow Pages
Next Message by Date:
click to view message preview
Re: Strip NOLAYER and everything inside? (urgent)
Hello, list!
Actually, I've got the problem solved in some way. I haven't found the
solution on how to delete everything inside NOLAYER, but I have
figured out that one can add a check if the element is
DescendantOf(element, TIDY_NOLAYER) in the MoveToHead function of
parser.c and then use DiscardElement(element) to discard the whole
stylesheet definition after it gets moved to HEAD from the NOLAYER
tag. Then TIDY will delete unneeded empty NOLAYER tags... that was
meant to defeat NetObjects Fusion code generator. Looks like a dirty
hack, but that works.
But finally it turned out that the task was to make TIDY just strip
off the NOLAYER tags, and not everything inside as well. I figured out
that we need to modify the ParseBlock function of parser.c like this:
---------------------------------------------------------------------
void ParseBlock( TidyDocImpl* doc, Node *element, uint mode)
{
Lexer* lexer = doc->lexer;
Node *node;
Bool checkstack = yes;
uint istackbase = 0;
// ZYV remove nolayer
if (TagIsId(element, TidyTag_NOLAYER )) {
ReportError(doc, element, element, DISCARDING_UNEXPECTED);
DiscardElement(doc, element);
return;
}
---------------------------------------------------------------------
That seems to work and pass all the regression tests. Please note that
it might not be the best solution, since I am absolutely new to TIDY's
source code and have a very rough idea on how the parser works.
Anyway, I thought that my findings might be useful for someone...
Thanks,
--
Sincerely yours,
Yury V. Zaytsev
Previous Message by Thread:
click to view message preview
Tidy UI, TidyLib, & HTML Reference Library
I just discovered the Help/About in Tidy UI and it gives a different author and a web site link (Charles Reitzel, http://tidy.sourceforge.net), but uses the old HTML Tidy logo. I went to the website and while my original question went unanswered, I did learn that Tidy UI is the latest version of Dave Raggett?s legacy.
The site features TidyLib, but it isn?t clear. It starts out as if it will explain what the program does, but mostly it seems to go on and on about its developement and how to continue work on its developement. Is TidyLib supposed to be simular to HTMLib by Steve LeHunte? I have been trying to find a current version of that program also. I use both programs from within my text editor, Boxer, to create and edit my HTML web pages. HTMLib is called as context-sensitive help.
I finally accessed the help file for Tidy UI which is available only when the user is online. I do not have 24/7 access to the internet and when I do there are times when I am not online. It would be helpful to have Tidy access a Help.HTML file in the directory on the hard drive where it is located.
Rod
----- Original Message ----- From: "Bjoern Hoehrmann" To: "Rod Lockwood" Subject: Re: HTML Tidy Date: Wed, 17 Aug 2005 17:53:20 +0200 * Rod Lockwood wrote: > In TidyGUI a warning states: > Characters codes for the Microsoft Windows fonts in the range > 128 - 159 may not be recognized on other platforms. You are > instead recommended to use named entities, e.g. ? rather > than Windows character code 153 (0x2122 in Unicode). > > So how do I get Tidy to convert the character codes into the named > entities? I would have thought you would have fixed that in Tidy UI. HTML Tidy does that automatically. -- Björn Höhrmann · mailto:bjoern@xxxxxxxxxxxx · http://bjoern.hoehrmann.de Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
--
_______________________________________________
Search for businesses by name, location, or phone number. -Lycos Yellow Pages
Next Message by Thread:
click to view message preview
Re: Strip NOLAYER and everything inside? (urgent)
Hello, list!
Actually, I've got the problem solved in some way. I haven't found the
solution on how to delete everything inside NOLAYER, but I have
figured out that one can add a check if the element is
DescendantOf(element, TIDY_NOLAYER) in the MoveToHead function of
parser.c and then use DiscardElement(element) to discard the whole
stylesheet definition after it gets moved to HEAD from the NOLAYER
tag. Then TIDY will delete unneeded empty NOLAYER tags... that was
meant to defeat NetObjects Fusion code generator. Looks like a dirty
hack, but that works.
But finally it turned out that the task was to make TIDY just strip
off the NOLAYER tags, and not everything inside as well. I figured out
that we need to modify the ParseBlock function of parser.c like this:
---------------------------------------------------------------------
void ParseBlock( TidyDocImpl* doc, Node *element, uint mode)
{
Lexer* lexer = doc->lexer;
Node *node;
Bool checkstack = yes;
uint istackbase = 0;
// ZYV remove nolayer
if (TagIsId(element, TidyTag_NOLAYER )) {
ReportError(doc, element, element, DISCARDING_UNEXPECTED);
DiscardElement(doc, element);
return;
}
---------------------------------------------------------------------
That seems to work and pass all the regression tests. Please note that
it might not be the best solution, since I am absolutely new to TIDY's
source code and have a very rough idea on how the parser works.
Anyway, I thought that my findings might be useful for someone...
Thanks,
--
Sincerely yours,
Yury V. Zaytsev
|
|