TAGSOUP(1)
okay bestie, welcome to TAGSOUP(1) from User Commands π β this is the manual for the HTML-to-XHTML glow-up. No cap, it's iconic.
Legal tea first, because yes: this file is part of TagSoup and is Copyright 2002-2008 by John Cowan. TagSoup is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at http://www.apache.org/licenses/LICENSE-2.0. You may also have additional legal rights not granted by this license. TagSoup is distributed in the hope that it will be useful, but unless required by applicable law or agreed to in writing, TagSoup is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied; not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
π NAME π
tagsoup β convert nasty, ugly HTML to clean XHTML β¨
β¨ SYNOPSIS β¨
java -jar tagsoup [ options ] [ files ]
πΈ DESCRIPTION πΈ
Rectify arbitrary HTML into clean XHTML, using a tailored description of HTML. The output will be well-formed XML, but not necessarily valid XHTML π«Ά.
π the options, all of them, no skipping π
--filesβ multiple input files should be processed into corresponding output files--encoding=encodingβ specifies the encoding of input files--output-encoding=encodingβ specifies the encoding of the output. If the encoding name begins withutf, the output will not contain character entities; otherwise, all non-ASCII characters are represented as entities--htmlβ output rectified HTML rather than XML, omitting the XML declaration and any namespace declarations--method=htmlβ output rectified HTML rather than XML (end-tags are omitted for empty elements, and no character escaping is done inscriptandstyleelements)--omit-xml-declarationβ omit the XML declaration--lexicalβ output lexical features (specifically comments and any DOCTYPE declaration)--nonsβ suppress namespaces in output--nobogonsβ suppress unknown non-HTML elements in output--nodefaultsβ suppress default attribute values--nocolonsβ change explicit colons in element and attribute names to underscores--norestartβ don't restart any restartable elements--ignorableβ pass through ignorable whitespace (whitespace in element-only content) via SAX method handlerignorableWhitespace--anyβ treat unknown non-HTML elements as allowing any content (default)--emptybogonsβ treat unknown non-HTML elements as empty elements--norootbogonsβ don't allow unknown non-HTML elements to be root elements--doctype-system=system-idβ force DOCTYPE declaration to be output with specified system identifier--doctype-public=public-idβ force DOCTYPE declaration to be output with specified public identifier--standalone=[yes|no]β specify standalone pseudo-attribute in output XML declaration--version=versionβ specify version pseudo-attribute in output XML declaration (does not affect actual version of XML output)--nocdataβ treat the CDATA-content elementsscriptandstyleas ordinary elements (mostly for testing)--pyxβ output PYX format rather than XML (mostly for testing)--pyxinβ input is PYX-format HTML (mostly for testing)--reuseβ reuse the sameParserobject internally (for testing only)--helpβ output basic help--versionβ output version number
π§ normal mode, files mode, and the repair era π§
TagSoup is a parser and reformatter for nasty, ugly HTML. Its normal processing mode is to accept HTML files on the command line, or from the standard input if none are given, and output them as clean XML to the standard output. The encoding is assumed to be the platform-local encoding on input, and is always UTF-8 on output β¨.
When the --files option is given, each input file is processed into an output file of the corresponding name, with the extension changed to xhtml. If the extension is already xhtml, it is changed to xhtml_.
TagSoup will repair, by whatever means necessary, violations of XML well-formedness. In particular, it will fix up malformed attribute names and supply missing attribute-value quotation marks. More significantly, it supplies end-tags where HTML allows them to be omitted, and sometimes where it doesn't. It will even supply start-tags where necessary; for example, if a document begins with a <li> tag, TagSoup will automatically prefix it with <html><body><ul> π
.
π BUGS π
real caveats, bestie β not just vibes.
TagSoup can be fooled by missing close quotes after attribute values, and by incorrect character encodings (it does not contain an encoding guesser).
TagSoup doesn't understand namespace declarations, which are not properly part of HTML. Instead, any element or attribute name beginning foo: will be put into the artificial namespace urn:x-prefix:foo.
For the same reasons, namespace-qualified attributes like xml:space can't be returned as default values, though an explicit attribute in the xml namespace will be returned with the proper namespace URI.
π AUTHOR π
John Cowan <cowan@ccil.org>
π COPYRIGHT π
Copyright Β© 2002-2008 John Cowan
TagSoup is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
TagSoup 1.2.1 Β· January 2008 Β· TAGSOUP(1) β mwah, bye bestie π
π¦ where this page comes from
- epel 10: tagsoup 1.2.1-35.el10_1 Β· Apache-2.0 AND (GPL-2.0-or-later OR LicenseRef-Callaway-AFL)
- epel 9: tagsoup 1.2.1-28.el9 Β· ASL 2.0 and (GPLv2+ or AFL)
- fedora 43: tagsoup 1.2.1-37.fc43 Β· Apache-2.0 AND (GPL-2.0-or-later OR LicenseRef-Callaway-AFL)
- fedora 44: tagsoup 1.2.1-38.fc44 Β· Apache-2.0 AND (GPL-2.0-or-later OR LicenseRef-Callaway-AFL)
- opensuse-leap 16.0: tagsoup 1.2.1-bp160.1.11 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms