home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / tidy26jul99 / localize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-08  |  20.6 KB  |  584 lines

  1. /*
  2.   localize.c
  3.  
  4.   (c) 1998 (W3C) MIT, INRIA, Keio University
  5.   See tidy.c for the copyright notice.
  6.  
  7.   You should only need to edit this file and tidy.c
  8.   to localize HTML tidy.
  9. */
  10.  
  11. #include "platform.h"
  12. #include "html.h"
  13.  
  14. #define ACCESS_URL  "http://www.w3.org/WAI/GL"
  15.  
  16. char *release_date = "26th July 1999";
  17.  
  18. /*
  19.  This routine is the single point via which
  20.  all output is written and as such is a good
  21.  way to interface Tidy to other code when
  22.  embedding Tidy in a GUI application.
  23. */
  24. void tidy_out(FILE *fp, const char* msg, ...)
  25. {
  26.     va_list args;
  27.     va_start(args, msg);
  28.     vfprintf(fp, msg, args);
  29.     va_end(args);
  30. }
  31.  
  32. void ReportTag(Lexer *lexer, Node *tag)
  33. {
  34.     if (tag)
  35.     {
  36.         if (tag->type == StartTag)
  37.             tidy_out(lexer->errout, "<%s>", tag->element);
  38.         else if (tag->type == EndTag)
  39.             tidy_out(lexer->errout, "</%s>", tag->element);
  40.         else if (tag->type == DocTypeTag)
  41.             tidy_out(lexer->errout, "<!DOCTYPE>");
  42.         else if (tag->type == TextNode)
  43.             tidy_out(lexer->errout, "plain text");
  44.         else
  45.             tidy_out(lexer->errout, "%s", tag->element);
  46.     }
  47. }
  48.  
  49. void NtoS(int n, char *str)
  50. {
  51.     char buf[40];
  52.     int i;
  53.  
  54.     for (i = 0;; ++i)
  55.     {
  56.         buf[i] = (n % 10) + '0';
  57.  
  58.         n = n /10;
  59.  
  60.         if (n == 0)
  61.             break;
  62.     }
  63.  
  64.     n = i;
  65.  
  66.     while (i >= 0)
  67.     {
  68.         str[n-i] = buf[i];
  69.         --i;
  70.     }
  71.  
  72.     str[n+1] = '\0';
  73. }
  74.  
  75. void ReportPosition(Lexer *lexer)
  76. {
  77.     tidy_out(lexer->errout, "line %d", lexer->lines);
  78.     tidy_out(lexer->errout, " column %d - ", lexer->columns);
  79. }
  80.  
  81. void ReportEncodingError(Lexer *lexer, uint code, uint c)
  82. {
  83.     char buf[32];
  84.  
  85.     lexer->warnings++;
  86.  
  87.     if (ShowWarnings)
  88.     {
  89.         ReportPosition(lexer);
  90.  
  91.         if (code == WINDOWS_CHARS)
  92.         {
  93.             NtoS(c, buf);
  94.             lexer->badChars |= WINDOWS_CHARS;
  95.             tidy_out(lexer->errout, "Warning: replacing illegal character code %s", buf);
  96.         }
  97.  
  98.         tidy_out(lexer->errout, "\n");
  99.     }
  100. }
  101.  
  102. void ReportEntityError(Lexer *lexer, uint code, char *entity, int c)
  103. {
  104.     lexer->warnings++;
  105.  
  106.     if (ShowWarnings)
  107.     {
  108.         ReportPosition(lexer);
  109.  
  110.  
  111.         if (code == MISSING_SEMICOLON)
  112.         {
  113.             tidy_out(lexer->errout, "Warning: entity \"%s\" doesn't end in ';'", entity);
  114.         }
  115.         else if (code == UNKNOWN_ENTITY)
  116.         {
  117.             tidy_out(lexer->errout, "Warning: unescaped & or unknown entity \"%s\"", entity);
  118.         }
  119.         else if (code == UNESCAPED_AMPERSAND)
  120.         {
  121.             tidy_out(lexer->errout, "Warning: unescaped & which should be written as &");
  122.         }
  123.  
  124.         tidy_out(lexer->errout, "\n");
  125.     }
  126. }
  127.  
  128. void ReportAttrError(Lexer *lexer, Node *node, char *attr, uint code)
  129. {
  130.     lexer->warnings++;
  131.  
  132.     /* keep quiet after 6 errors */
  133.     if (lexer->errors > 6)
  134.         return;
  135.  
  136.     if (ShowWarnings)
  137.     {
  138.         /* on end of file adjust reported position to end of input */
  139.         if (code == UNEXPECTED_END_OF_FILE)
  140.         {
  141.             lexer->lines = lexer->in->curline;
  142.             lexer->columns = lexer->in->curcol;
  143.         }
  144.  
  145.         ReportPosition(lexer);
  146.  
  147.         if (code == UNKNOWN_ATTRIBUTE)
  148.             tidy_out(lexer->errout, "Warning: unknown attribute \"%s\"", attr);
  149.         else if (code == MISSING_ATTRIBUTE)
  150.         {
  151.             tidy_out(lexer->errout, "Warning: ");
  152.             ReportTag(lexer, node);
  153.             tidy_out(lexer->errout, " lacks \"%s\" attribute", attr);
  154.         }
  155.         else if (code == MISSING_ATTR_VALUE)
  156.         {
  157.             tidy_out(lexer->errout, "Warning: ");
  158.             ReportTag(lexer, node);
  159.             tidy_out(lexer->errout, " missing value for \"%s\" attribute", attr);
  160.         }
  161.         else if (code == MISSING_IMAGEMAP)
  162.         {
  163.             tidy_out(lexer->errout, "Warning: ");
  164.             ReportTag(lexer, node);
  165.             tidy_out(lexer->errout, " should use client-side image map");
  166.             lexer->badAccess |= MISSING_IMAGE_MAP;
  167.         }
  168.         else if (code == BAD_ATTRIBUTE_VALUE)
  169.         {
  170.             tidy_out(lexer->errout, "Warning: ");
  171.             ReportTag(lexer, node);
  172.             tidy_out(lexer->errout, " unrecognized attribute value \"%s\"", attr);
  173.         }
  174.         else if (code == XML_ATTRIBUTE_VALUE)
  175.         {
  176.             tidy_out(lexer->errout, "Warning: ");
  177.             ReportTag(lexer, node);
  178.             tidy_out(lexer->errout, " has XML attribute \"%s\"", attr);
  179.         }
  180.         else if (code == UNEXPECTED_GT)
  181.         {
  182.             tidy_out(lexer->errout, "Error: ");
  183.             ReportTag(lexer, node);
  184.             tidy_out(lexer->errout, " missing '>' for end of tag");
  185.             lexer->errors++;;
  186.         }
  187.         else if (code == UNEXPECTED_QUOTEMARK)
  188.         {
  189.             tidy_out(lexer->errout, "Warning: ");
  190.             ReportTag(lexer, node);
  191.             tidy_out(lexer->errout, " unexpected or duplicate quote mark");
  192.         }
  193.         else if (code == PROPRIETARY_ATTR_VALUE)
  194.         {
  195.             tidy_out(lexer->errout, "Warning: ");
  196.             ReportTag(lexer, node);
  197.             tidy_out(lexer->errout, " proprietary attribute value \"%s\"", attr);
  198.         }
  199.         else if (code == UNEXPECTED_END_OF_FILE)
  200.         {
  201.             tidy_out(lexer->errout, "Warning: end of file while parsing attributes");
  202.         }
  203.  
  204.         tidy_out(lexer->errout, "\n");
  205.     }
  206.     else if (code == UNEXPECTED_GT)
  207.     {
  208.         ReportPosition(lexer);
  209.         tidy_out(lexer->errout, "Error: ");
  210.         ReportTag(lexer, node);
  211.         tidy_out(lexer->errout, " missing '>' for end of tag\n");
  212.         lexer->errors++;;
  213.     }
  214. }
  215.  
  216. void ReportWarning(Lexer *lexer, Node *element, Node *node, uint code)
  217. {
  218.     lexer->warnings++;
  219.  
  220.     /* keep quiet after 6 errors */
  221.     if (lexer->errors > 6)
  222.         return;
  223.  
  224.     if (ShowWarnings)
  225.     {
  226.         /* on end of file adjust reported position to end of input */
  227.         if (code == UNEXPECTED_END_OF_FILE)
  228.         {
  229.             lexer->lines = lexer->in->curline;
  230.             lexer->columns = lexer->in->curcol;
  231.         }
  232.  
  233.         ReportPosition(lexer);
  234.  
  235.         if (code == MISSING_ENDTAG_FOR)
  236.             tidy_out(lexer->errout, "Warning: missing </%s>", element->element);
  237.         else if (code == MISSING_ENDTAG_BEFORE)
  238.         {
  239.             tidy_out(lexer->errout, "Warning: missing </%s> before ", element->element);
  240.             ReportTag(lexer, node);
  241.         }
  242.         else if (code == DISCARDING_UNEXPECTED)
  243.         {
  244.             tidy_out(lexer->errout, "Warning: discarding unexpected ");
  245.             ReportTag(lexer, node);
  246.         }
  247.         else if (code == FORCED_END_ANCHOR)
  248.         {
  249.             tidy_out(lexer->errout, "Warning: <a> is probably intended as </a>");
  250.         }
  251.         else if (code == NON_MATCHING_ENDTAG)
  252.         {
  253.             tidy_out(lexer->errout, "Warning: replacing unexpected ");
  254.             ReportTag(lexer, node);
  255.             tidy_out(lexer->errout, " by </%s>", element->element);
  256.         }
  257.         else if (code == TAG_NOT_ALLOWED_IN)
  258.         {
  259.             tidy_out(lexer->errout, "Warning: ");
  260.             ReportTag(lexer, node);
  261.             tidy_out(lexer->errout, " isn't allowed in <%s> elements", element->element);
  262.         }
  263.         else if (code == DOCTYPE_AFTER_TAGS)
  264.         {
  265.             tidy_out(lexer->errout, "Warning: <!DOCTYPE> isn't allowed after elements");
  266.         }
  267.         else if (code == MISSING_STARTTAG)
  268.             tidy_out(lexer->errout, "Warning: missing <%s>", node->element);
  269.          else if (code == UNEXPECTED_ENDTAG)
  270.             tidy_out(lexer->errout, "Warning: unexpected </%s>", node->element);
  271.         else if (code == USING_BR_INPLACE_OF)
  272.         {
  273.             tidy_out(lexer->errout, "Warning: using <br> in place of ");
  274.             ReportTag(lexer, node);
  275.         }
  276.         else if (code == INSERTING_TAG)
  277.             tidy_out(lexer->errout, "Warning: inserting implicit <%s>", node->element);
  278.         else if (code == CANT_BE_NESTED)
  279.         {
  280.             tidy_out(lexer->errout, "Warning: ");
  281.             ReportTag(lexer, node);
  282.             tidy_out(lexer->errout, " can't be nested");
  283.         }
  284.         else if (code == PROPRIETARY_ELEMENT)
  285.         {
  286.             tidy_out(lexer->errout, "Warning: ");
  287.             ReportTag(lexer, node);
  288.             tidy_out(lexer->errout, " is not approved by W3C");
  289.  
  290.             if (node->tag == tag_layer)
  291.                 lexer->badLayout |= USING_LAYER;
  292.             else if (node->tag == tag_spacer)
  293.                 lexer->badLayout |= USING_SPACER;
  294.             else if (node->tag == tag_nobr)
  295.                 lexer->badLayout |= USING_NOBR;
  296.         }
  297.         else if (code == OBSOLETE_ELEMENT)
  298.         {
  299.             tidy_out(lexer->errout, "Warning: replacing obsolete element ");
  300.             ReportTag(lexer, element);
  301.             tidy_out(lexer->errout, " by ");
  302.             ReportTag(lexer, node);
  303.         }
  304.         else if (code == TRIM_EMPTY_ELEMENT)
  305.         {
  306.             tidy_out(lexer->errout, "Warning: trimming empty ");
  307.             ReportTag(lexer, element);
  308.         }
  309.         else if (code == MISSING_TITLE_ELEMENT)
  310.             tidy_out(lexer->errout, "Warning: inserting missing 'title' element");
  311.         else if (code == ILLEGAL_NESTING)
  312.         {
  313.             tidy_out(lexer->errout, "Warning: ");
  314.             ReportTag(lexer, element);
  315.             tidy_out(lexer->errout, " shouldn't be nested");
  316.         }
  317.         else if (code == NOFRAMES_CONTENT)
  318.         {
  319.             tidy_out(lexer->errout, "Warning: ");
  320.             ReportTag(lexer, node);
  321.             tidy_out(lexer->errout, " not inside 'noframes' element");
  322.         }
  323.         else if (code == INCONSISTENT_VERSION)
  324.         {
  325.             tidy_out(lexer->errout, "Warning: html doctype doesn't match content");
  326.         }
  327.         else if (code == MALFORMED_DOCTYPE)
  328.         {
  329.             tidy_out(lexer->errout, "Warning: expected \"html PUBLIC\" or \"html SYSTEM\"");
  330.         }
  331.         else if (code == CONTENT_AFTER_BODY)
  332.         {
  333.             tidy_out(lexer->errout, "Warning: content occurs after end of body");
  334.         }
  335.         else if (code == BAD_COMMENT)
  336.         {
  337.             tidy_out(lexer->errout, "Warning: malformed comment");
  338.         }
  339.         else if (code == BAD_CDATA_CONTENT)
  340.         {
  341.             tidy_out(lexer->errout, "Warning: '<' + '/' + letter not allowed here");
  342.         }
  343.         else if (code == INCONSISTENT_NAMESPACE)
  344.         {
  345.             tidy_out(lexer->errout, "Warning: html namespace doesn't match content");
  346.         }
  347.         else if (code == UNEXPECTED_END_OF_FILE)
  348.         {
  349.             tidy_out(lexer->errout, "Warning: unexpected end of file");
  350.             ReportTag(lexer, element);
  351.         }
  352.  
  353.         tidy_out(lexer->errout, "\n");
  354.     }
  355. }
  356.  
  357. void ReportError(Lexer *lexer, Node *element, Node *node, uint code)
  358. {
  359.     lexer->warnings++;
  360.  
  361.     /* keep quiet after 6 errors */
  362.     if (lexer->errors > 6)
  363.         return;
  364.  
  365.     lexer->errors++;
  366.  
  367.     ReportPosition(lexer);
  368.  
  369.     if (code == SUSPECTED_MISSING_QUOTE)
  370.     {
  371.         tidy_out(lexer->errout, "Error: missing quotemark for attribute value");
  372.     }
  373.     else if (code == DUPLICATE_FRAMESET)
  374.     {
  375.         tidy_out(lexer->errout, "Error: repeated FRAMESET element");
  376.     }
  377.     else if (code == UNKNOWN_ELEMENT)
  378.     {
  379.         tidy_out(lexer->errout, "Error: ");
  380.         ReportTag(lexer, node);
  381.         tidy_out(lexer->errout, " is not recognized!");
  382.     }
  383.  
  384.     tidy_out(lexer->errout, "\n");
  385. }
  386.  
  387. void ErrorSummary(Lexer *lexer)
  388. {
  389.     /* adjust badAccess to that its null if frames are ok */
  390.     if (lexer->badAccess & (USING_FRAMES | USING_NOFRAMES))
  391.     {
  392.         if (!((lexer->badAccess & USING_FRAMES) && !(lexer->badAccess & USING_NOFRAMES)))
  393.             lexer->badAccess &= ~(USING_FRAMES | USING_NOFRAMES);
  394.     }
  395.  
  396.     if (lexer->badChars)
  397.     {
  398.         if (lexer->badChars & WINDOWS_CHARS)
  399.         {
  400.             tidy_out(lexer->errout, "Characters codes for the Microsoft Windows fonts in the range\n");
  401.             tidy_out(lexer->errout, "128 - 159 may not be recognized on other platforms. You are\n");
  402.             tidy_out(lexer->errout, "instead recommended to use named entities, e.g. ™ rather\n");
  403.             tidy_out(lexer->errout, "than Windows character code 153 (0x2122 in Unicode). Note that\n");
  404.             tidy_out(lexer->errout, "as of February 1998 few browsers support the new entities.\n\n");
  405.         }
  406.     }
  407.  
  408.     if (lexer->badForm)
  409.     {
  410.         tidy_out(lexer->errout, "You may need to move one or both of the <form> and </form>\n");
  411.         tidy_out(lexer->errout, "tags. HTML elements should be properly nested and form elements\n");
  412.         tidy_out(lexer->errout, "are no exception. For instance you should not place the <form>\n");
  413.         tidy_out(lexer->errout, "in one table cell and the </form> in another. If the <form> is\n");
  414.         tidy_out(lexer->errout, "placed before a table, the </form> cannot be placed inside the\n");
  415.         tidy_out(lexer->errout, "table! Note that one form can't be nested inside another!\n\n");
  416.     }
  417.     
  418.     if (lexer->badAccess)
  419.     {
  420.         if (lexer->badAccess & MISSING_SUMMARY)
  421.         {
  422.             tidy_out(lexer->errout, "The table summary attribute should be used to describe\n");
  423.             tidy_out(lexer->errout, "the table structure. It is very helpful for people using\n");
  424.             tidy_out(lexer->errout, "non-visual browsers. The scope and headers attributes for\n");
  425.             tidy_out(lexer->errout, "table cells are useful for specifying which headers apply\n");
  426.             tidy_out(lexer->errout, "to each table cell, enabling non-visual browsers to provide\n");
  427.             tidy_out(lexer->errout, "a meaningful context for each cell.\n\n");
  428.         }
  429.  
  430.         if (lexer->badAccess & MISSING_IMAGE_ALT)
  431.         {
  432.             tidy_out(lexer->errout, "The alt attribute should be used to give a short description\n");
  433.             tidy_out(lexer->errout, "of an image; longer descriptions should be given with the\n");
  434.             tidy_out(lexer->errout, "longdesc attribute which takes a URL linked to the description.\n");
  435.             tidy_out(lexer->errout, "These measures are needed for people using non-graphical browsers.\n\n");
  436.         }
  437.  
  438.         if (lexer->badAccess & MISSING_IMAGE_MAP)
  439.         {
  440.             tidy_out(lexer->errout, "Use client-side image maps in preference to server-side image\n");
  441.             tidy_out(lexer->errout, "maps as the latter are inaccessible to people using non-\n");
  442.             tidy_out(lexer->errout, "graphical browsers. In addition, client-side maps are easier\n");
  443.             tidy_out(lexer->errout, "to set up and provide immediate feedback to users.\n\n");
  444.         }
  445.  
  446.         if (lexer->badAccess & MISSING_LINK_ALT)
  447.         {
  448.             tidy_out(lexer->errout, "For hypertext links defined using a client-side image map, you\n");
  449.             tidy_out(lexer->errout, "need to use the alt attribute to provide a textual description\n");
  450.             tidy_out(lexer->errout, "of the link for people using non-graphical browsers.\n\n");
  451.         }
  452.  
  453.         if ((lexer->badAccess & USING_FRAMES) && !(lexer->badAccess & USING_NOFRAMES))
  454.         {
  455.             tidy_out(lexer->errout, "Pages designed using frames presents problems for\n");
  456.             tidy_out(lexer->errout, "people who are either blind or using a browser that\n");
  457.             tidy_out(lexer->errout, "doesn't support frames. A frames-based page should always\n");
  458.             tidy_out(lexer->errout, "include an alternative layout inside a NOFRAMES element.\n\n");
  459.         }
  460.  
  461.         tidy_out(lexer->errout, "For further advice on how to make your pages accessible\n");
  462.         tidy_out(lexer->errout, "see \"%s\". You may also want to try\n", ACCESS_URL);
  463.         tidy_out(lexer->errout, "\"http://www.cast.org/bobby/\" which is a free Web-based\n");
  464.         tidy_out(lexer->errout, "service for checking URLs for accessibility.\n\n");
  465.     }
  466.  
  467.     if (lexer->badLayout)
  468.     {
  469.         if (lexer->badLayout & USING_LAYER)
  470.         {
  471.             tidy_out(lexer->errout, "The Cascading Style Sheets (CSS) Positioning mechanism\n");
  472.             tidy_out(lexer->errout, "is recommended in preference to the proprietary <LAYER>\n");
  473.             tidy_out(lexer->errout, "element due to limited vendor support for LAYER.\n\n");
  474.         }
  475.  
  476.         if (lexer->badLayout & USING_SPACER)
  477.         {
  478.             tidy_out(lexer->errout, "You are recommended to use CSS for controlling white\n");
  479.             tidy_out(lexer->errout, "space (e.g. for indentation, margins and line spacing).\n");
  480.             tidy_out(lexer->errout, "The proprietary <SPACER> element has limited vendor support.\n\n");
  481.         }
  482.  
  483.         if (lexer->badLayout & USING_FONT)
  484.         {
  485.             tidy_out(lexer->errout, "You are recommended to use CSS to specify the font and\n");
  486.             tidy_out(lexer->errout, "properties such as its size and color. This will reduce\n");
  487.             tidy_out(lexer->errout, "the size of HTML files and make them easier maintain\n");
  488.             tidy_out(lexer->errout, "compared with using <FONT> elements.\n\n");
  489.         }
  490.  
  491.         if (lexer->badLayout & USING_NOBR)
  492.         {
  493.             tidy_out(lexer->errout, "You are recommended to use CSS to control line wrapping.\n");
  494.             tidy_out(lexer->errout, "Use \"white-space: nowrap\" to inhibit wrapping in place\n");
  495.             tidy_out(lexer->errout, "of inserting <NOBR>...</NOBR> into the markup.\n\n");
  496.         }
  497.     }
  498. }
  499.  
  500. void UnknownOption(FILE *errout, char c)
  501. {
  502.     tidy_out(errout, "unrecognized option -%c use -help to list options\n", c);
  503. }
  504.  
  505. void UnknownFile(FILE *errout, char *program, char *file)
  506. {
  507.     tidy_out(errout, "%s: can't open file \"%s\"\n", program, file);
  508. }
  509.  
  510. void NeedsAuthorIntervention(FILE *errout)
  511. {
  512.     tidy_out(errout, "This document has errors that must be fixed before\n");
  513.     tidy_out(errout, "using HTML Tidy to generate a tidied up version.\n\n");
  514. }
  515.  
  516. void MissingBody(FILE *errout)
  517. {
  518.     tidy_out(errout, "Can't create slides - document is missing a body element.\n");
  519. }
  520.  
  521. void ReportNumberOfSlides(FILE *errout, int count)
  522. {
  523.     tidy_out(errout, "%d Slides found\n", count);
  524. }
  525.  
  526. void GeneralInfo(FILE *errout)
  527. {
  528.     tidy_out(errout, "HTML & CSS specifications are available from http://www.w3.org/\n");
  529.     tidy_out(errout, "To learn more about Tidy see http://www.w3.org/People/Raggett/tidy/\n");
  530.     tidy_out(errout, "Please send bug reports to Dave Raggett care of <html-tidy@w3.org>\n");
  531.     tidy_out(errout, "Lobby your company to join W3C, see http://www.w3.org/Consortium\n");
  532. }
  533.  
  534. void HelloMessage(FILE *errout, char *date, char *filename)
  535. {
  536.     tidy_out(errout, "\nTidy (vers %s) Parsing \"%s\"\n", date, filename);
  537. }
  538.  
  539. void ReportVersion(FILE *errout, char *filename, char *vers)
  540. {
  541.     tidy_out(errout, "\n\"%s\" appears to be %s\n", filename, (vers ? vers : "HTML proprietary"));
  542. }
  543.  
  544. void ReportNumWarnings(FILE *errout, Lexer *lexer)
  545. {
  546.     if (lexer->warnings > 0)
  547.         tidy_out(errout, "%d warnings/errors were found!\n\n", lexer->warnings);
  548.     else
  549.         tidy_out(errout, "no warnings or errors were found\n\n");
  550. }
  551.  
  552. void HelpText(FILE *out, char *prog)
  553. {
  554.     tidy_out(out, "%s: file1 file2 ...\n", prog);
  555.     tidy_out(out, "Utility to clean up & pretty print html files\n");
  556.     tidy_out(out, "see http://www.w3.org/People/Raggett/tidy/\n");
  557.     tidy_out(out, "options for tidy released on %s\n", release_date);
  558.     tidy_out(out, "  -config <file>  set options from config file\n");
  559.     tidy_out(out, "  -indent or -i   indent element content\n");
  560.     tidy_out(out, "  -omit   or -o   omit optional endtags\n");
  561.     tidy_out(out, "  -wrap 72        wrap text at column 72 (default is 68)\n");
  562.     tidy_out(out, "  -upper  or -u   force tags to upper case (default is lower)\n");
  563.     tidy_out(out, "  -clean  or -c   replace font, nobr & center tags by CSS\n");
  564.     tidy_out(out, "  -raw            leave chars > 128 unchanged upon output\n");
  565.     tidy_out(out, "  -ascii          use ASCII for output, Latin-1 for input\n");
  566.     tidy_out(out, "  -latin1         use Latin-1 for both input and output\n");
  567.     tidy_out(out, "  -iso2022        use ISO2022 for both input and output\n");
  568.     tidy_out(out, "  -utf8           use UTF-8 for both input and output\n");
  569.     tidy_out(out, "  -numeric or -n  output numeric rather than named entities\n");
  570.     tidy_out(out, "  -modify or -m   to modify original files\n");
  571.     tidy_out(out, "  -errors or -e   only show errors\n");
  572.     tidy_out(out, "  -f <file>       write errors to <file>\n");
  573.     tidy_out(out, "  -xml            use this when input is wellformed xml\n");
  574.     tidy_out(out, "  -asxml          to convert html to wellformed xml\n");
  575.     tidy_out(out, "  -slides         to burst into slides on h2 elements\n");
  576.     tidy_out(out, "  -help   or -h   list command line options\n");
  577.     tidy_out(out, "Input/Output default to stdin/stdout respectively\n");
  578.     tidy_out(out, "Single letter options apart from -f may be combined\n");
  579.     tidy_out(out, "as in:  tidy -f errs.txt -imu foo.html\n");
  580.     tidy_out(out, "For further info on HTML see http://www.w3.org/MarkUp\n");
  581. }
  582.  
  583.  
  584.