W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2000

Re: tidy on html-kit: "new tags" question

From: Richard A. O'Keefe <ok@atlas.otago.ac.nz>
Date: Wed, 30 Aug 2000 12:39:36 +1200 (NZST)
Message-Id: <200008300039.MAA16176@atlas.otago.ac.nz>
To: Alex.Fung.Ho-san@graduate.hku.hk, dsr@w3.org
Cc: gerald@w3.org, html-tidy@w3.org
	On Fri, 18 Aug 2000, Alex Fung wrote:
	> 2) If I do not say input is XML, then it will do a lovely thing:
	> it converts "<br>"s to "<BR />". However, it won't happen if I
	> tell tidy that it is XML. OTOH, if I don't say input is XML,
	> then Tidy always add some HTML tags (head, title, etc) to my
	> file. How can I have <BR /> conversion but without the <head>
	> etc tags added?
Why not do it the long way around?
Let Tidy add the header and trailer lines you don't want,
but then strip them out?  For example, in UNIX, you could do

tidy -asxml InputFile | sed -e '1,/^<body>/d' -e '/^<\/body>/,$d' >OutputFile

(throw away lines from the beginning up to and including <body>,
 throw away lines from and including </body> to the end,
 copy the rest)

It worked when I tried it.
Received on Tuesday, 29 August 2000 20:40:03 UTC

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