W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2001

Re: RFE: using Tidy to strip out comments from HTML

From: Klaus Johannes Rusch <KlausRusch@atmedia.net>
Date: Sun, 18 Feb 2001 12:46:08 CET
Message-Id: <200102181342.IAA08198@tux.w3.org>
To: html-tidy@w3.org
In <20010214190338.52846.qmail@web11601.mail.yahoo.com>, Erik Talvola <talvola@yahoo.com> writes:
> A question came up at work recently about whether
> there was a quick and dirty script to remove all HTML
> comments from a page.  I figured, well Tidy must do
> it, but didn't see any option.

pprint.c has a routine for printing comments:

  static void PPrintComment(Out *fout, uint indent,
                   Lexer *lexer, Node *node)

You can disable comments by disabling output in this route (or add an extra 
option to remove comments, might be a nice addition for the tidy base also)

Keep in mind that some comments may not really be intended as comments, e.g.

// hide this from old browsers -->

Klaus Johannes Rusch
Received on Sunday, 18 February 2001 08:42:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:49 UTC