{
    "mode": "man",
    "parameter": "tidy",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/tidy/1/json",
    "generated": "2026-06-03T00:21:16Z",
    "synopsis": "tidy [options] [file ...] [options] [file ...] ...",
    "sections": {
        "NAME": {
            "content": "tidy - check, correct, and pretty-print HTML(5) files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tidy [options] [file ...] [options] [file ...] ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Tidy reads HTML, XHTML, and XML files and writes cleaned-up markup.  For HTML variants, it\ndetects, reports, and corrects many common coding errors and strives to produce visually\nequivalent markup that is both conformant to the HTML specifications and that works in most\nbrowsers.\n\nA common use of Tidy is to convert plain HTML to XHTML.  For generic XML files, Tidy is\nlimited to correcting basic well-formedness errors and pretty printing.\n\nIf no input file is specified, Tidy reads the standard input.  If no output file is\nspecified, Tidy writes the tidied markup to the standard output.  If no error file is\nspecified, Tidy writes messages to the standard error.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Tidy supports two different kinds of options.  Purely command-line options, starting with a\nsingle dash '-', can only be used on the command-line, not in configuration files.  They are\nlisted in the first part of this section.  Configuration options, on the other hand, can\neither be passed on the command line, starting with two dashes --, or specified in a\nconfiguration file, using the option name, followed by a colon :, plus the value, without the\nstarting dashes. They are listed in the second part of this section, with a sample config\nfile.\n\nFor command-line options that expect a numerical argument, a default is assumed if no\nmeaningful value can be found.  On the other hand, configuration options cannot be used\nwithout a value; a configuration option without a value is simply discarded and reported as\nan error.\n\nUsing a command-line option is sometimes equivalent to setting the value of a configuration\noption.  The equivalent option and value are shown in parentheses in the list below, as they\nwould appear in a configuration file.  For example, -quiet, -q (quiet: yes) means that using\nthe command-line option -quiet or -q is equivalent to setting the configuration option quiet\nto yes.\n\nSingle-letter command-line options without an associated value can be combined; for example\n'-i', '-m' and '-u' may be combined as '-imu'.\n",
            "subsections": [
                {
                    "name": "File manipulation",
                    "content": ""
                },
                {
                    "name": "-output -o",
                    "content": "write output to the specified <file>\n",
                    "flag": "-o"
                },
                {
                    "name": "-config <file>",
                    "content": "set configuration options from the specified <file>\n"
                },
                {
                    "name": "-file -f",
                    "content": "write errors and warnings to the specified <file>\n",
                    "flag": "-f"
                },
                {
                    "name": "-modify -m",
                    "content": "modify the original input files\n",
                    "flag": "-m"
                },
                {
                    "name": "Processing directives",
                    "content": ""
                },
                {
                    "name": "-indent -i",
                    "content": "indent element content\n",
                    "flag": "-i"
                },
                {
                    "name": "-wrap -w",
                    "content": "wrap text at the specified <column>. 0 is assumed if <column> is missing. When this\noption is omitted, the default of the configuration option 'wrap' applies.\n",
                    "flag": "-w"
                },
                {
                    "name": "-upper -u",
                    "content": "force tags to upper case\n",
                    "flag": "-u"
                },
                {
                    "name": "-clean -c",
                    "content": "replace FONT, NOBR and CENTER tags with CSS\n",
                    "flag": "-c"
                },
                {
                    "name": "-bare -b",
                    "content": "strip out smart quotes and em dashes, etc.\n",
                    "flag": "-b"
                },
                {
                    "name": "-gdoc -g",
                    "content": "produce clean version of html exported by Google Docs\n",
                    "flag": "-g"
                },
                {
                    "name": "-numeric -n",
                    "content": "output numeric rather than named entities\n",
                    "flag": "-n"
                },
                {
                    "name": "-errors -e",
                    "content": "show only errors and warnings\n",
                    "flag": "-e"
                },
                {
                    "name": "-quiet -q",
                    "content": "suppress nonessential output\n",
                    "flag": "-q"
                },
                {
                    "name": "-omit",
                    "content": "omit optional start tags and end tags\n"
                },
                {
                    "name": "-xml",
                    "content": "specify the input is well formed XML\n"
                },
                {
                    "name": "-asxml -asxhtml",
                    "content": "convert HTML to well formed XHTML\n"
                },
                {
                    "name": "-ashtml",
                    "content": "force XHTML to well formed HTML\n"
                },
                {
                    "name": "-access",
                    "content": "do additional accessibility checks (<level> = 0, 1, 2, 3). 0 is assumed if <level> is\nmissing.\n"
                },
                {
                    "name": "Character encodings",
                    "content": ""
                },
                {
                    "name": "-raw",
                    "content": ""
                },
                {
                    "name": "-ascii",
                    "content": ""
                },
                {
                    "name": "-latin0",
                    "content": "use ISO-8859-15 for input, US-ASCII for output\n"
                },
                {
                    "name": "-latin1",
                    "content": "use ISO-8859-1 for both input and output\n"
                },
                {
                    "name": "-iso2022",
                    "content": "use ISO-2022 for both input and output\n"
                },
                {
                    "name": "-utf8",
                    "content": ""
                },
                {
                    "name": "-mac",
                    "content": ""
                },
                {
                    "name": "-win1252",
                    "content": "use Windows-1252 for input, US-ASCII for output\n"
                },
                {
                    "name": "-ibm858",
                    "content": "use IBM-858 (CP850+Euro) for input, US-ASCII for output\n"
                },
                {
                    "name": "-utf16le",
                    "content": "use UTF-16LE for both input and output\n"
                },
                {
                    "name": "-utf16be",
                    "content": "use UTF-16BE for both input and output\n"
                },
                {
                    "name": "-utf16",
                    "content": ""
                },
                {
                    "name": "-big5",
                    "content": ""
                },
                {
                    "name": "-shiftjis",
                    "content": "use ShiftJIS for both input and output\n"
                },
                {
                    "name": "Miscellaneous",
                    "content": ""
                },
                {
                    "name": "-version -v",
                    "content": "show the version of Tidy\n",
                    "flag": "-v"
                },
                {
                    "name": "-help -h -?",
                    "content": "list the command line options\n",
                    "flag": "-?"
                },
                {
                    "name": "-help-config",
                    "content": "list all configuration options\n"
                },
                {
                    "name": "-help-env",
                    "content": "show information about the environment and runtime configuration\n"
                },
                {
                    "name": "-show-config",
                    "content": "list the current configuration settings\n"
                },
                {
                    "name": "-export-config",
                    "content": "list the current configuration settings, suitable for a config file\n"
                },
                {
                    "name": "-export-default-config",
                    "content": "list the default configuration settings, suitable for a config file\n"
                },
                {
                    "name": "-help-option <option>",
                    "content": "show a description of the <option>\n"
                },
                {
                    "name": "-language",
                    "content": "set Tidy's output language to <lang>. Specify '-language help' for more help. Use\nbefore output-causing arguments to ensure the language takes effect, e.g.,`tidy -lang\nes -lang help`.\n\nXML"
                },
                {
                    "name": "-xml-help",
                    "content": "list the command line options in XML format\n"
                },
                {
                    "name": "-xml-config",
                    "content": "list all configuration options in XML format\n"
                },
                {
                    "name": "-xml-strings",
                    "content": "output all of Tidy's strings in XML format\n"
                },
                {
                    "name": "-xml-error-strings",
                    "content": "output error constants and strings in XML format\n"
                },
                {
                    "name": "-xml-options-strings",
                    "content": "output option descriptions in XML format\n\nConfiguration options can be specified by preceding each option with -- at the command line,\nfollowed by its desired value, OR by placing the options and values in a configuration file,\nand telling tidy to read that file with the -config option:\n\ntidy --option1 value1 --option2 value2 ...\ntidy -config config-file  ...\n\nConfiguration options can be conveniently grouped in a single config file.  A Tidy\nconfiguration file is simply a text file, where each option is listed on a separate line in\nthe form\n\noption1: value1\noption2: value2\netc.\n\nThe permissible values for a given option depend on the option's Type.  There are five Types:\nBoolean, AutoBool, DocType, Enum, and String.  Boolean Types allow any of yes/no, y/n,\ntrue/false, t/f, 1/0.  AutoBools allow auto in addition to the values allowed by Booleans.\nInteger Types take non-negative integers.  String Types generally have no defaults, and you\nshould provide them in non-quoted form (unless you wish the output to contain the literal\nquotes).\n\nEnum, Encoding, and DocType Types have a fixed repertoire of items, which are listed in the\nSupported values sections below.\n\nYou only need to provide options and values for those whose defaults you wish to override,\nalthough you may wish to include some already-defaulted options and values for the sake of\ndocumentation and explicitness.\n\nHere is a sample config file, with at least one example of each of the five Types:\n\n// sample Tidy configuration options\noutput-xhtml: yes\nadd-xml-decl: no\ndoctype: strict\nchar-encoding: ascii\nindent: auto\nwrap: 76\nrepeated-attributes: keep-last\nerror-file: errs.txt\n\nBelow is a summary and brief description of each of the options.  They are listed\nalphabetically within each category.\n"
                },
                {
                    "name": "Document Display options",
                    "content": "--gnu-emacs Boolean (no if unset)\nThis option specifies if Tidy should change the format for reporting errors and\nwarnings to a format that is more easily parsed by GNU Emacs.\n\n--markup Boolean (yes if unset)\nThis option specifies if Tidy should generate a pretty printed version of the markup.\nNote that Tidy won't generate a pretty printed version if it finds significant errors\n(see force-output).\n\n--mute String\nUse this option to prevent Tidy from displaying certain types of report output, for\nexample, for conditions that you wish to ignore.\n\nThis option takes a list of one or more keys indicating the message type to mute. You\ncan discover these message keys by using the mute-id configuration option and\nexamining Tidy's output.\n\nSee also: --mute-id\n\n--mute-id Boolean (no if unset)\nThis option indicates whether or not Tidy should display message ID's with each of its\nerror reports. This could be useful if you wanted to use the mute configuration option\nin order to filter out certain report messages.\n\nSee also: --mute\n\n--quiet Boolean (no if unset)\nWhen enabled, this option limits Tidy's non-document output to report only document\nwarnings and errors.\n\n--show-body-only Enum (no if unset)\nSupported values: no, yes, auto\n\nThis option specifies if Tidy should print only the contents of the body tag as an\nHTML fragment.\n\nIf set to auto, this is performed only if the body tag has been inferred.\n\nUseful for incorporating existing whole pages as a portion of another page.\n\nThis option has no effect if XML output is requested.\n\n--show-errors Integer (6 if unset)\nThis option specifies the number Tidy uses to determine if further errors should be\nshown. If set to 0, then no errors are shown.\n\n--show-info Boolean (yes if unset)\nThis option specifies if Tidy should display info-level messages.\n\n--show-warnings Boolean (yes if unset)\nThis option specifies if Tidy should suppress warnings. This can be useful when a few\nerrors are hidden in a flurry of warnings.\n"
                },
                {
                    "name": "Document In and Out options",
                    "content": "--add-meta-charset Boolean (no if unset)\nThis option, when enabled, adds a <meta> element and sets the charset attribute to the\nencoding of the document. Set this option to yes to enable it.\n\n--add-xml-decl Boolean (no if unset)\nThis option specifies if Tidy should add the XML declaration when outputting XML or\nXHTML.\n\nNote that if the input already includes an <?xml ... ?> declaration then this option\nwill be ignored.\n\nIf the encoding for the output is different from ascii, one of the utf* encodings, or\nraw, then the declaration is always added as required by the XML standard.\n\nSee also: --char-encoding, --output-encoding\n\n--add-xml-space Boolean (no if unset)\nThis option specifies if Tidy should add xml:space=\"preserve\" to elements such as\n<pre>, <style> and <script> when generating XML.\n\nThis is needed if the whitespace in such elements is to be parsed appropriately\nwithout having access to the DTD.\n\n--doctype String (auto if unset)\nThis option specifies the DOCTYPE declaration generated by Tidy.\n\nIf set to omit the output won't contain a DOCTYPE declaration. Note this this also\nimplies numeric-entities is set to yes.\n\nIf set to html5 the DOCTYPE is set to <!DOCTYPE html>.\n\nIf set to auto (the default) Tidy will use an educated guess based upon the contents\nof the document. Note that selecting this option will not change the current\ndocument's DOCTYPE on output.\n\nIf set to strict, Tidy will set the DOCTYPE to the HTML4 or XHTML1 strict DTD.\n\nIf set to loose, the DOCTYPE is set to the HTML4 or XHTML1 loose (transitional) DTD.\n\nAlternatively, you can supply a string for the formal public identifier (FPI).\n\nFor example:\n\ndoctype: \"-//ACME//DTD HTML 3.14159//EN\"\n\nIf you specify the FPI for an XHTML document, Tidy will set the system identifier to\nan empty string. For an HTML document, Tidy adds a system identifier only if one was\nalready present in order to preserve the processing mode of some browsers. Tidy leaves\nthe DOCTYPE for generic XML documents unchanged.\n\nThis option does not offer a validation of document conformance.\n\n--input-xml Boolean (no if unset)\nThis option specifies if Tidy should use the XML parser rather than the error\ncorrecting HTML parser.\n\n--output-html Boolean (no if unset)\nThis option specifies if Tidy should generate pretty printed output, writing it as\nHTML.\n\n--output-xhtml Boolean (no if unset)\nThis option specifies if Tidy should generate pretty printed output, writing it as\nextensible HTML.\n\nThis option causes Tidy to set the DOCTYPE and default namespace as appropriate to\nXHTML, and will use the corrected value in output regardless of other sources.\n\nFor XHTML, entities can be written as named or numeric entities according to the\nsetting of numeric-entities.\n\nThe original case of tags and attributes will be preserved, regardless of other\noptions.\n\n--output-xml Boolean (no if unset)\nThis option specifies if Tidy should pretty print output, writing it as well-formed\nXML.\n\nAny entities not defined in XML 1.0 will be written as numeric entities to allow them\nto be parsed by an XML parser.\n\nThe original case of tags and attributes will be preserved, regardless of other\noptions.\n"
                },
                {
                    "name": "File Input-Output options",
                    "content": "--error-file String\nThis option specifies the error file Tidy uses for errors and warnings. Normally\nerrors and warnings are output to stderr.\n\nSee also: --output-file\n\n--keep-time Boolean (no if unset)\nThis option specifies if Tidy should keep the original modification time of files that\nTidy modifies in place.\n\nSetting the option to yes allows you to tidy files without changing the file\nmodification date, which may be useful with certain tools that use the modification\ndate for things such as automatic server deployment.\n\nNote this feature is not supported on some platforms.\n\n--output-file String\nThis option specifies the output file Tidy uses for markup. Normally markup is written\nto stdout.\n\nSee also: --error-file\n\n--write-back Boolean (no if unset)\nThis option specifies if Tidy should write back the tidied markup to the same file it\nread from.\n\nYou are advised to keep copies of important files before tidying them, as on rare\noccasions the result may not be what you expect.\n"
                },
                {
                    "name": "Diagnostics options",
                    "content": "--accessibility-check Enum (0 (Tidy Classic) if unset)\nSupported values: 0 (Tidy Classic), 1 (Priority 1 Checks), 2 (Priority 2 Checks), 3\n(Priority 3 Checks)\n\nThis option specifies what level of accessibility checking, if any, that Tidy should\nperform.\n\nLevel 0 (Tidy Classic) is equivalent to Tidy Classic's accessibility checking.\n\nFor more information on Tidy's accessibility checking, visit Tidy's Accessibility Page\nat http://www.html-tidy.org/accessibility/.\n\n--force-output Boolean (no if unset)\nThis option specifies if Tidy should produce output even if errors are encountered.\n\nUse this option with care; if Tidy reports an error, this means Tidy was not able to\n(or is not sure how to) fix the error, so the resulting output may not reflect your\nintention.\n\n--show-meta-change Boolean (no if unset)\nThis option enables a message whenever Tidy changes the content attribute of a meta\ncharset declaration to match the encoding of the document. Set this option to yes to\nenable it.\n\n--warn-proprietary-attributes Boolean (yes if unset)\nThis option specifies if Tidy should warn on proprietary attributes.\n"
                },
                {
                    "name": "Encoding options",
                    "content": "--char-encoding Encoding (utf8 if unset)\nSupported values: raw, ascii, latin0, latin1, utf8, iso2022, mac, win1252, ibm858,\nutf16le, utf16be, utf16, big5, shiftjis\n\nThis option specifies the character encoding Tidy uses for input, and when set,\nautomatically chooses an appropriate character encoding to be used for output. The\noutput encoding Tidy chooses may be different from the input encoding.\n\nFor ascii, latin0, ibm858, mac, and win1252 input encodings, the output-encoding\noption will automatically be set to ascii. You can set output-encoding manually to\noverride this.\n\nFor other input encodings, the output-encoding option will automatically be set to the\nthe same value.\n\nRegardless of the preset value, you can set output-encoding manually to override this.\n\nTidy is not an encoding converter. Although the Latin and UTF encodings can be mixed\nfreely, it is not possible to convert Asian encodings to Latin encodings with Tidy.\n\nSee also: --input-encoding, --output-encoding\n\n--input-encoding Encoding (utf8 if unset)\nSupported values: raw, ascii, latin0, latin1, utf8, iso2022, mac, win1252, ibm858,\nutf16le, utf16be, utf16, big5, shiftjis\n\nThis option specifies the character encoding Tidy uses for input. Tidy makes certain\nassumptions about some of the input encodings.\n\nFor ascii, Tidy will accept Latin-1 (ISO-8859-1) character values and convert them to\nentities as necessary.\n\nFor raw, Tidy will make no assumptions about the character values and will pass them\nunchanged to output.\n\nFor mac and win1252, vendor specific characters values will be accepted and converted\nto entities as necessary.\n\nAsian encodings such as iso2022 will be handled appropriately assuming the\ncorresponding output-encoding is also specified.\n\nTidy is not an encoding converter. Although the Latin and UTF encodings can be mixed\nfreely, it is not possible to convert Asian encodings to Latin encodings with Tidy.\n\nSee also: --char-encoding\n\n--newline Enum (LF if unset)\nSupported values: LF, CRLF, CR\n\nThe default is appropriate to the current platform.\n\nGenrally CRLF on PC-DOS, Windows and OS/2; CR on Classic Mac OS; and LF everywhere\nelse (Linux, macOS, and Unix).\n\n--output-bom Enum (auto if unset)\nSupported values: no, yes, auto\n\nThis option specifies if Tidy should write a Unicode Byte Order Mark character (BOM;\nalso known as Zero Width No-Break Space; has value of U+FEFF) to the beginning of the\noutput, and only applies to UTF-8 and UTF-16 output encodings.\n\nIf set to auto this option causes Tidy to write a BOM to the output only if a BOM was\npresent at the beginning of the input.\n\nA BOM is always written for XML/XHTML output using UTF-16 output encodings.\n\n--output-encoding Encoding (utf8 if unset)\nSupported values: raw, ascii, latin0, latin1, utf8, iso2022, mac, win1252, ibm858,\nutf16le, utf16be, utf16, big5, shiftjis\n\nThis option specifies the character encoding Tidy uses for output. Some of the output\nencodings affect whether or not some characters are translated to entities, although\nin all cases, some entities will be written according to other Tidy configuration\noptions.\n\nFor ascii, mac, and win1252 output encodings, entities will be used for all characters\nwith values over 127.\n\nFor raw output, Tidy will write values above 127 without translating them to entities.\n\nOutput using latin1 will cause Tidy to write character values higher than 255 as\nentities.\n\nThe UTF family such as utf8 will write output in the respective UTF encoding.\n\nAsian output encodings such as iso2022 will write output in the specified encoding,\nassuming a corresponding input-encoding was specified.\n\nTidy is not an encoding converter. Although the Latin and UTF encodings can be mixed\nfreely, it is not possible to convert Asian encodings to Latin encodings with Tidy.\n\nSee also: --char-encoding\n"
                },
                {
                    "name": "Cleanup options",
                    "content": "--bare Boolean (no if unset)\nThis option specifies if Tidy should strip Microsoft specific HTML from Word 2000\ndocuments, and output spaces rather than non-breaking spaces where they exist in the\ninput.\n\n--clean Boolean (no if unset)\nThis option specifies if Tidy should perform cleaning of some legacy presentational\ntags (currently <i>, <b>, <center> when enclosed within appropriate inline tags, and\n<font>). If set to yes, then the legacy tags will be replaced with CSS <style> tags\nand structural markup as appropriate.\n\n--drop-empty-elements Boolean (yes if unset)\nThis option specifies if Tidy should discard empty elements.\n\n--drop-empty-paras Boolean (yes if unset)\nThis option specifies if Tidy should discard empty paragraphs.\n\n--drop-proprietary-attributes Boolean (no if unset)\nThis option specifies if Tidy should strip out proprietary attributes, such as\nMicrosoft data binding attributes. Additionally attributes that aren't permitted in\nthe output version of HTML will be dropped if used with strict-tags-attributes.\n\n--gdoc Boolean (no if unset)\nThis option specifies if Tidy should enable specific behavior for cleaning up HTML\nexported from Google Docs.\n\n--logical-emphasis Boolean (no if unset)\nThis option specifies if Tidy should replace any occurrence of <i> with <em> and any\noccurrence of <b> with <strong>. Any attributes are preserved unchanged.\n\nThis option can be set independently of the clean option.\n\n--merge-divs Enum (auto if unset)\nSupported values: no, yes, auto\n\nThis option can be used to modify the behavior of clean when set to yes.\n\nThis option specifies if Tidy should merge nested <div> such as\n<div><div>...</div></div>.\n\nIf set to auto the attributes of the inner <div> are moved to the outer one. Nested\n<div> with id attributes are not merged.\n\nIf set to yes the attributes of the inner <div> are discarded with the exception of\nclass and style.\n\nSee also: --clean, --merge-spans\n\n--merge-spans Enum (auto if unset)\nSupported values: no, yes, auto\n\nThis option can be used to modify the behavior of clean when set to yes.\n\nThis option specifies if Tidy should merge nested <span> such as\n<span><span>...</span></span>.\n\nThe algorithm is identical to the one used by merge-divs.\n\nSee also: --clean, --merge-divs\n\n--word-2000 Boolean (no if unset)\nThis option specifies if Tidy should go to great pains to strip out all the surplus\nstuff Microsoft Word 2000 inserts when you save Word documents as \"Web pages\". It\ndoesn't handle embedded images or VML.\n\nYou should consider saving using Word's Save As..., and choosing Web Page, Filtered.\n"
                },
                {
                    "name": "Entities options",
                    "content": "--ascii-chars Boolean (no if unset)\nCan be used to modify behavior of the clean option when set to yes.\n\nIf set to yes when using clean, &emdash;, &rdquo;, and other named character entities\nare downgraded to their closest ASCII equivalents.\n\nSee also: --clean\n\n--ncr Boolean (yes if unset)\nThis option specifies if Tidy should allow numeric character references.\n\n--numeric-entities Boolean (no if unset)\nThis option specifies if Tidy should output entities other than the built-in HTML\nentities (&amp;, &lt;, &gt;, and &quot;) in the numeric rather than the named entity\nform.\n\nOnly entities compatible with the DOCTYPE declaration generated are used.\n\nEntities that can be represented in the output encoding are translated\ncorrespondingly.\n\nSee also: --doctype, --preserve-entities\n\n--preserve-entities Boolean (no if unset)\nThis option specifies if Tidy should preserve well-formed entities as found in the\ninput.\n\n--quote-ampersand Boolean (yes if unset)\nThis option specifies if Tidy should output unadorned & characters as &amp;.\n\n--quote-marks Boolean (no if unset)\nThis option specifies if Tidy should output \" characters as &quot; as is preferred by\nsome editing environments.\n\nThe apostrophe character ' is written out as &#39; since many web browsers don't yet\nsupport &apos;.\n\n--quote-nbsp Boolean (yes if unset)\nThis option specifies if Tidy should output non-breaking space characters as entities,\nrather than as the Unicode character value 160 (decimal).\n"
                },
                {
                    "name": "Repair options",
                    "content": "--alt-text String\nThis option specifies the default alt= text Tidy uses for <img> attributes when the\nalt= attribute is missing.\n\nUse with care, as it is your responsibility to make your documents accessible to\npeople who cannot see the images.\n\n--anchor-as-name Boolean (yes if unset)\nThis option controls the deletion or addition of the name attribute in elements where\nit can serve as anchor.\n\nIf set to yes a name attribute, if not already existing, is added along an existing id\nattribute if the DTD allows it.\n\nIf set to no any existing name attribute is removed if an id attribute exists or has\nbeen added.\n\n--assume-xml-procins Boolean (no if unset)\nThis option specifies if Tidy should change the parsing of processing instructions to\nrequire ?> as the terminator rather than >.\n\nThis option is automatically set if the input is in XML.\n\n--coerce-endtags Boolean (yes if unset)\nThis option specifies if Tidy should coerce a start tag into an end tag in cases where\nit looks like an end tag was probably intended; for example, given\n\n<span>foo <b>bar<b> baz</span>\n\nTidy will output\n\n<span>foo <b>bar</b> baz</span>\n\n--css-prefix String (c if unset)\nThis option specifies the prefix that Tidy uses for styles rules.\n\nBy default, c will be used.\n\n--custom-tags Enum (no if unset)\nSupported values: no, blocklevel, empty, inline, pre\n\nThis option enables the use of tags for autonomous custom elements, e.g. <flag-icon>\nwith Tidy. Custom tags are disabled if this value is no. Other settings - blocklevel,\nempty, inline, and pre will treat all detected custom tags accordingly.\n\nThe use of new-blocklevel-tags, new-empty-tags, new-inline-tags, or new-pre-tags will\noverride the treatment of custom tags by this configuration option. This may be useful\nif you have different types of custom tags.\n\nWhen enabled these tags are determined during the processing of your document using\nopening tags; matching closing tags will be recognized accordingly, and unknown\nclosing tags will be discarded.\n\nSee also: --new-blocklevel-tags, --new-empty-tags, --new-inline-tags, --new-pre-tags\n\n--enclose-block-text Boolean (no if unset)\nThis option specifies if Tidy should insert a <p> element to enclose any text it finds\nin any element that allows mixed content for HTML transitional but not HTML strict.\n\n--enclose-text Boolean (no if unset)\nThis option specifies if Tidy should enclose any text it finds in the body element\nwithin a <p> element.\n\nThis is useful when you want to take existing HTML and use it with a style sheet.\n\n--escape-scripts Boolean (yes if unset)\nThis option causes items that look like closing tags, like </g to be escaped to <\\/g.\nSet this option to no if you do not want this.\n\n--fix-backslash Boolean (yes if unset)\nThis option specifies if Tidy should replace backslash characters \\ in URLs with\nforward slashes /.\n\n--fix-bad-comments Enum (auto if unset)\nSupported values: no, yes, auto\n\nThis option specifies if Tidy should replace unexpected hyphens with = characters when\nit comes across adjacent hyphens.\n\nThe default is auto will which will act as no for HTML5 document types, and yes for\nall other document types.\n\nHTML has abandonded SGML comment syntax, and allows adjacent hypens for all versions\nof HTML, although XML and XHTML do not. If you plan to support older browsers that\nrequire SGML comment syntax, then consider setting this value to yes.\n\n--fix-style-tags Boolean (yes if unset)\nThis option specifies if Tidy should move all style tags to the head of the document.\n\n--fix-uri Boolean (yes if unset)\nThis option specifies if Tidy should check attribute values that carry URIs for\nillegal characters and if such are found, escape them as HTML4 recommends.\n\n--literal-attributes Boolean (no if unset)\nThis option specifies how Tidy deals with whitespace characters within attribute\nvalues.\n\nIf the value is no Tidy normalizes attribute values by replacing any newline or tab\nwith a single space, and further by replacing any contiguous whitespace with a single\nspace.\n\nTo force Tidy to preserve the original, literal values of all attributes and ensure\nthat whitespace within attribute values is passed through unchanged, set this option\nto yes.\n\n--lower-literals Boolean (yes if unset)\nThis option specifies if Tidy should convert the value of an attribute that takes a\nlist of predefined values to lower case.\n\nThis is required for XHTML documents.\n\n--repeated-attributes Enum (keep-last if unset)\nSupported values: keep-first, keep-last\n\nThis option specifies if Tidy should keep the first or last attribute, if an attribute\nis repeated, e.g. has two align attributes.\n\nSee also: --join-classes, --join-styles\n\n--skip-nested Boolean (yes if unset)\nThis option specifies that Tidy should skip nested tags when parsing script and style\ndata.\n\n--strict-tags-attributes Boolean (no if unset)\nThis options ensures that tags and attributes are applicable for the version of HTML\nthat Tidy outputs. When set to yes and the output document type is a strict doctype,\nthen Tidy will report errors. If the output document type is a loose or transitional\ndoctype, then Tidy will report warnings.\n\nAdditionally if drop-proprietary-attributes is enabled, then not applicable attributes\nwill be dropped, too.\n\nWhen set to no, these checks are not performed.\n\n--uppercase-attributes Enum (no if unset)\nSupported values: no, yes, preserve\n\nThis option specifies if Tidy should output attribute names in upper case.\n\nWhen set to no, attribute names will be written in lower case. Specifying yes will\noutput attribute names in upper case, and preserve can used to leave attribute names\nuntouched.\n\nWhen using XML input, the original case is always preserved.\n\n--uppercase-tags Boolean (no if unset)\nThis option specifies if Tidy should output tag names in upper case.\n\nThe default is no which results in lower case tag names, except for XML input where\nthe original case is preserved.\n"
                },
                {
                    "name": "Transformation options",
                    "content": "--decorate-inferred-ul Boolean (no if unset)\nThis option specifies if Tidy should decorate inferred <ul> elements with some CSS\nmarkup to avoid indentation to the right.\n\n--escape-cdata Boolean (no if unset)\nThis option specifies if Tidy should convert <![CDATA[]]> sections to normal text.\n\n--hide-comments Boolean (no if unset)\nThis option specifies if Tidy should not print out comments.\n\n--join-classes Boolean (no if unset)\nThis option specifies if Tidy should combine class names to generate a single, new\nclass name if multiple class assignments are detected on an element.\n\n--join-styles Boolean (yes if unset)\nThis option specifies if Tidy should combine styles to generate a single, new style if\nmultiple style values are detected on an element.\n\n--merge-emphasis Boolean (yes if unset)\nThis option specifies if Tidy should merge nested <b> and <i> elements; for example,\nfor the case\n\n<b class=\"rtop-2\">foo <b class=\"r2-2\">bar</b> baz</b>,\n\nTidy will output <b class=\"rtop-2\">foo bar baz</b>.\n\n--replace-color Boolean (no if unset)\nThis option specifies if Tidy should replace numeric values in color attributes with\nHTML/XHTML color names where defined, e.g. replace #ffffff with white.\n"
                },
                {
                    "name": "Teaching Tidy options",
                    "content": "--new-blocklevel-tags Tag Names\nSupported values: tagX, tagY, ...\n\nThis option specifies new block-level tags. This option takes a space or comma\nseparated list of tag names.\n\nUnless you declare new tags, Tidy will refuse to generate a tidied file if the input\nincludes previously unknown tags.\n\nNote you can't change the content model for elements such as <table>, <ul>, <ol> and\n<dl>.\n\nThis option is ignored in XML mode.\n\nSee also: --new-empty-tags, --new-inline-tags, --new-pre-tags, --custom-tags\n\n--new-empty-tags Tag Names\nSupported values: tagX, tagY, ...\n\nThis option specifies new empty inline tags. This option takes a space or comma\nseparated list of tag names.\n\nUnless you declare new tags, Tidy will refuse to generate a tidied file if the input\nincludes previously unknown tags.\n\nRemember to also declare empty tags as either inline or blocklevel.\n\nThis option is ignored in XML mode.\n\nSee also: --new-blocklevel-tags, --new-inline-tags, --new-pre-tags, --custom-tags\n\n--new-inline-tags Tag Names\nSupported values: tagX, tagY, ...\n\nThis option specifies new non-empty inline tags. This option takes a space or comma\nseparated list of tag names.\n\nUnless you declare new tags, Tidy will refuse to generate a tidied file if the input\nincludes previously unknown tags.\n\nThis option is ignored in XML mode.\n\nSee also: --new-blocklevel-tags, --new-empty-tags, --new-pre-tags, --custom-tags\n\n--new-pre-tags Tag Names\nSupported values: tagX, tagY, ...\n\nThis option specifies new tags that are to be processed in exactly the same way as\nHTML's <pre> element. This option takes a space or comma separated list of tag names.\n\nUnless you declare new tags, Tidy will refuse to generate a tidied file if the input\nincludes previously unknown tags.\n\nNote you cannot as yet add new CDATA elements.\n\nThis option is ignored in XML mode.\n\nSee also: --new-blocklevel-tags, --new-empty-tags, --new-inline-tags, --custom-tags\n"
                },
                {
                    "name": "Pretty Print options",
                    "content": "--break-before-br Boolean (no if unset)\nThis option specifies if Tidy should output a line break before each <br> element.\n\n--indent Enum (no if unset)\nSupported values: no, yes, auto\n\nThis option specifies if Tidy should indent block-level tags.\n\nIf set to auto Tidy will decide whether or not to indent the content of tags such as\n<title>, <h1>-<h6>, <li>, <td>, or <p> based on the content including a block-level\nelement.\n\nSetting indent to yes can expose layout bugs in some browsers.\n\nUse the option indent-spaces to control the number of spaces or tabs output per level\nof indent, and indent-with-tabs to specify whether spaces or tabs are used.\n\nSee also: --indent-spaces\n\n--indent-attributes Boolean (no if unset)\nThis option specifies if Tidy should begin each attribute on a new line.\n\n--indent-cdata Boolean (no if unset)\nThis option specifies if Tidy should indent <![CDATA[]]> sections.\n\n--indent-spaces Integer (2 if unset)\nThis option specifies the number of spaces or tabs that Tidy uses to indent content\nwhen indent is enabled.\n\nNote that the default value for this option is dependent upon the value of indent-\nwith-tabs (see also).\n\nSee also: --indent\n\n--indent-with-tabs Boolean (no if unset)\nThis option specifies if Tidy should indent with tabs instead of spaces, assuming\nindent is yes.\n\nSet it to yes to indent using tabs instead of the default spaces.\n\nUse the option indent-spaces to control the number of tabs output per level of indent.\nNote that when indent-with-tabs is enabled the default value of indent-spaces is reset\nto 1.\n\nNote tab-size controls converting input tabs to spaces. Set it to zero to retain input\ntabs.\n\n--keep-tabs Boolean (no if unset)\nWith the default no Tidy will replace all source tabs with spaces, controlled by the\noption tab-size, and the current line offset. Of course, except in the special\nblocks/elements enumerated below, this will later be reduced to just one space.\n\nIf set yes this option specifies Tidy should keep certain tabs found in the source,\nbut only in preformatted blocks like <pre>, and other CDATA elements like <script>,\n<style>, and other pseudo elements like <?php ... ?>. As always, all other tabs, or\nsequences of tabs, in the source will continue to be replaced with a space.\n\n--omit-optional-tags Boolean (no if unset)\nThis option specifies if Tidy should omit optional start tags and end tags when\ngenerating output.\n\nSetting this option causes all tags for the <html>, <head>, and <body> elements to be\nomitted from output, as well as such end tags as </p>, </li>, </dt>, </dd>, </option>,\n</tr>, </td>, and </th>.\n\nThis option is ignored for XML output.\n\n--priority-attributes Attributes Names\nSupported values: attributeX, attributeY, ...\n\nThis option allows prioritizing the writing of attributes in tidied documents,\nallowing them to written before the other attributes of an element. For example, you\nmight specify that id and name are written before every other attribute.\n\nThis option takes a space or comma separated list of attribute names.\n\n--punctuation-wrap Boolean (no if unset)\nThis option specifies if Tidy should line wrap after some Unicode or Chinese\npunctuation characters.\n\n--sort-attributes Enum (none if unset)\nSupported values: none, alpha\n\nThis option specifies that Tidy should sort attributes within an element using the\nspecified sort algorithm. If set to alpha, the algorithm is an ascending alphabetic\nsort.\n\nWhen used while sorting with priority-attributes, any attribute sorting will take\nplace after the priority attributes have been output.\n\nSee also: --priority-attributes\n\n--tab-size Integer (8 if unset)\nThis option specifies the number of columns that Tidy uses between successive tab\nstops. It is used to map tabs to spaces when reading the input.\n\n--tidy-mark Boolean (yes if unset)\nThis option specifies if Tidy should add a meta element to the document head to\nindicate that the document has been tidied.\n\nTidy won't add a meta element if one is already present.\n\n--vertical-space Enum (no if unset)\nSupported values: no, yes, auto\n\nThis option specifies if Tidy should add some extra empty lines for readability.\n\nThe default is no.\n\nIf set to auto Tidy will eliminate nearly all newline characters.\n\n--wrap Integer (68 if unset)\nThis option specifies the right margin Tidy uses for line wrapping.\n\nTidy tries to wrap lines so that they do not exceed this length.\n\nSet wrap to 0 (zero) if you want to disable line wrapping.\n\n--wrap-asp Boolean (yes if unset)\nThis option specifies if Tidy should line wrap text contained within ASP pseudo\nelements, which look like: <% ... %>.\n\n--wrap-attributes Boolean (no if unset)\nThis option specifies if Tidy should line-wrap attribute values, meaning that if the\nvalue of an attribute causes a line to exceed the width specified by wrap, Tidy will\nadd one or more line breaks to the value, causing it to be wrapped into multiple\nlines.\n\nNote that this option can be set independently of wrap-script-literals. By default\nTidy replaces any newline or tab with a single space and replaces any sequences of\nwhitespace with a single space.\n\nTo force Tidy to preserve the original, literal values of all attributes, and ensure\nthat whitespace characters within attribute values are passed through unchanged, set\nliteral-attributes to yes.\n\nSee also: --wrap-script-literals, --literal-attributes\n\n--wrap-jste Boolean (yes if unset)\nThis option specifies if Tidy should line wrap text contained within JSTE pseudo\nelements, which look like: <# ... #>.\n\n--wrap-php Boolean (yes if unset)\nThis option specifies if Tidy should line wrap text contained within PHP pseudo\nelements, which look like: <?php ... ?>.\n\n--wrap-script-literals Boolean (no if unset)\nThis option specifies if Tidy should line wrap string literals that appear in script\nattributes.\n\nTidy wraps long script string literals by inserting a backslash character before the\nline break.\n\nSee also: --wrap-attributes\n\n--wrap-sections Boolean (yes if unset)\nThis option specifies if Tidy should line wrap text contained within <![ ... ]>\nsection tags.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "HTMLTIDY\nName of the default configuration file.  This should be an absolute path, since you\nwill probably invoke tidy from different directories.  The value of HTMLTIDY will be\nparsed after the compiled-in default (defined with -DTIDYCONFIGFILE), but before any\nof the files specified using -config.\n\n\nRUNTIME CONFIGURATION FILES\nYou can also specify runtime configuration files from which tidy will attempt to load\na configuration automatically.\n\nThe system runtime configuration file (/etc/tidy.conf), if it exists will be loaded\nand applied first, followed by the user runtime configuration file (~/.tidyrc).\nSubsequent usage of a specific option will override any previous usage.\n\nNote that if you use the HTMLTIDY environment variable, then the user runtime\nconfiguration file will not be used. This is a feature, not a bug.\n\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "0      All input files were processed successfully.\n\n1      There were warnings.\n\n2      There were errors.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "For more information about HTML Tidy:\n\nhttp://www.html-tidy.org/\n\nFor more information on HTML:\n\nHTML: Edition for Web Authors (the latest HTML specification)\nhttp://dev.w3.org/html5/spec-author-view\n\nHTML: The Markup Language (an HTML language reference)\nhttp://dev.w3.org/html5/markup/\n\nFor bug reports and comments:\n\nhttps://github.com/htacg/tidy-html5/issues/\n\nOr send questions and comments to public-htacg@w3.org.\n\nValidate your HTML documents using the W3C Nu Markup Validator:\n\nhttp://validator.w3.org/nu/\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Tidy was written by Dave Raggett <dsr@w3.org>, and subsequently maintained by a team at\nhttp://tidy.sourceforge.net/, and now maintained by HTACG (http://www.htacg.org).\n\nThe sources for HTML Tidy are available at https://github.com/htacg/tidy-html5/ under the MIT\nLicence.\n\n\n\nHTML Tidy                                       5.6.0                                        TIDY(1)",
            "subsections": []
        }
    },
    "summary": "tidy - check, correct, and pretty-print HTML(5) files",
    "flags": [
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "write output to the specified <file>"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "set configuration options from the specified <file>"
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "write errors and warnings to the specified <file>"
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "modify the original input files"
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "indent element content"
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": "wrap text at the specified <column>. 0 is assumed if <column> is missing. When this option is omitted, the default of the configuration option 'wrap' applies."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "force tags to upper case"
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "replace FONT, NOBR and CENTER tags with CSS"
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "strip out smart quotes and em dashes, etc."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "produce clean version of html exported by Google Docs"
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "output numeric rather than named entities"
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "show only errors and warnings"
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "suppress nonessential output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "omit optional start tags and end tags"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "specify the input is well formed XML"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "convert HTML to well formed XHTML"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "force XHTML to well formed HTML"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "do additional accessibility checks (<level> = 0, 1, 2, 3). 0 is assumed if <level> is missing."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use ISO-8859-15 for input, US-ASCII for output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use ISO-8859-1 for both input and output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use ISO-2022 for both input and output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use Windows-1252 for input, US-ASCII for output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use IBM-858 (CP850+Euro) for input, US-ASCII for output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use UTF-16LE for both input and output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use UTF-16BE for both input and output"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use ShiftJIS for both input and output"
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "show the version of Tidy"
        },
        {
            "flag": "-?",
            "long": null,
            "arg": null,
            "description": "list the command line options"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "list all configuration options"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "show information about the environment and runtime configuration"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "list the current configuration settings"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "list the current configuration settings, suitable for a config file"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "list the default configuration settings, suitable for a config file"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "show a description of the <option>"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "set Tidy's output language to <lang>. Specify '-language help' for more help. Use before output-causing arguments to ensure the language takes effect, e.g.,`tidy -lang es -lang help`. XML"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "list the command line options in XML format"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "list all configuration options in XML format"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "output all of Tidy's strings in XML format"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "output error constants and strings in XML format"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "output option descriptions in XML format Configuration options can be specified by preceding each option with -- at the command line, followed by its desired value, OR by placing the options and values in a configuration file, and telling tidy to read that file with the -config option: tidy --option1 value1 --option2 value2 ... tidy -config config-file ... Configuration options can be conveniently grouped in a single config file. A Tidy configuration file is simply a text file, where each option is listed on a separate line in the form option1: value1 option2: value2 etc. The permissible values for a given option depend on the option's Type. There are five Types: Boolean, AutoBool, DocType, Enum, and String. Boolean Types allow any of yes/no, y/n, true/false, t/f, 1/0. AutoBools allow auto in addition to the values allowed by Booleans. Integer Types take non-negative integers. String Types generally have no defaults, and you should provide them in non-quoted form (unless you wish the output to contain the literal quotes). Enum, Encoding, and DocType Types have a fixed repertoire of items, which are listed in the Supported values sections below. You only need to provide options and values for those whose defaults you wish to override, although you may wish to include some already-defaulted options and values for the sake of documentation and explicitness. Here is a sample config file, with at least one example of each of the five Types: // sample Tidy configuration options output-xhtml: yes add-xml-decl: no doctype: strict char-encoding: ascii indent: auto wrap: 76 repeated-attributes: keep-last error-file: errs.txt Below is a summary and brief description of each of the options. They are listed alphabetically within each category."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Clean up and pretty print HTML, XHTML, and XML files.",
        "examples": [
            {
                "description": "Pretty print an HTML file",
                "command": "tidy {{path/to/file.html}}"
            },
            {
                "description": "Enable indentation, wrapping lines in 100, saving to `output.html`",
                "command": "tidy {{-i|--indent}} y {{-w|--wrap}} 100 {{-o|-output}} {{path/to/output.html}} {{path/to/file.html}}"
            },
            {
                "description": "Modify an HTML file in-place using a configuration file",
                "command": "tidy -config {{path/to/configuration}} {{-m|-modify}} {{path/to/file.html}}"
            }
        ]
    }
}