Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added show-info option. Fixes #6.

  • Loading branch information...
commit d194e8726e6ca703a650b13fcd8834c9c9d52c84 1 parent 880221e
@sideshowbarker sideshowbarker authored
View
1  include/tidyenum.h
@@ -108,6 +108,7 @@ typedef enum
TidyOutFile, /**< File name to write markup to */
TidyWriteBack, /**< If true then output tidied markup */
TidyShowMarkup, /**< If false, normal output is suppressed */
+ TidyShowInfo, /**< If true, info-level messages are shown */
TidyShowWarnings, /**< However errors are always shown */
TidyQuiet, /**< No 'Parsing X', guessed DTD or summary */
TidyIndentContent, /**< Indent content of appropriate tags */
View
1  index.html
@@ -376,6 +376,7 @@ <h2 id="new-config">New configuration options</h2>
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#drop-empty-elements">drop-empty-elements</a>
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#merge-emphasis">merge-emphasis</a>
<li><a href="http://w3c.github.com/tidy-html5/quickref.html#omit-optional-tags">omit-optional-tags</a>
+<li><a href="http://w3c.github.com/tidy-html5/quickref.html#show-info">show-info</a>
</ul>
<p>In addition, it also adds a new <code>html5</code> value for the
<a href="http://w3c.github.com/tidy-html5/quickref.html#doctype">doctype</a>
View
26 quickref.html
@@ -8,7 +8,7 @@
<body>
<h1 id="top">Quick Reference</h1>
<h2>HTML Tidy Configuration Options</h2>
- <p>Version: <a href="https://github.com/w3c/tidy-html5/tree/abc1e3f">https://github.com/w3c/tidy-html5/tree/abc1e3f</a></p>
+ <p>Version: <a href="https://github.com/w3c/tidy-html5/tree/1f21625">https://github.com/w3c/tidy-html5/tree/1f21625</a></p>
<p>
<a class="h3" href="#MarkupHeader">HTML, XHTML, XML</a>
<br />
@@ -450,6 +450,13 @@ <h1 id="top">Quick Reference</h1>
</tr>
<tr>
<td>
+ <a href="#show-info">show-info</a>
+ </td>
+ <td>Boolean</td>
+ <td>yes</td>
+ </tr>
+ <tr>
+ <td>
<a href="#show-warnings">show-warnings</a>
</td>
<td>Boolean</td>
@@ -1764,6 +1771,23 @@ <h1 id="top">Quick Reference</h1>
<td>&#160;</td>
</tr>
<tr>
+ <td class="tabletitle" valign="top" id="show-info">show-info</td>
+ <td class="tabletitlelink" valign="top" align="right">
+ <a href="#top">Top</a>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">Type: <strong>Boolean</strong><br />
+ Default: <strong>yes</strong><br />Example: <strong>y/n, yes/no, t/f, true/false, 1/0</strong></td>
+ <td align="right" valign="top"></td>
+ </tr>
+ <tr>
+ <td colspan="2">This option specifies if Tidy should display info-level messages. </td>
+ </tr>
+ <tr>
+ <td>&#160;</td>
+ </tr>
+ <tr>
<td class="tabletitle" valign="top" id="show-warnings">show-warnings</td>
<td class="tabletitlelink" valign="top" align="right">
<a href="#top">Top</a>
View
1  src/config.c
@@ -236,6 +236,7 @@ static const TidyOptionImpl option_defs[] =
{ TidyOutFile, MS, "output-file", ST, 0, ParseString, NULL },
{ TidyWriteBack, MS, "write-back", BL, no, ParseBool, boolPicks },
{ TidyShowMarkup, PP, "markup", BL, yes, ParseBool, boolPicks },
+ { TidyShowInfo, DG, "show-info", BL, yes, ParseBool, boolPicks },
{ TidyShowWarnings, DG, "show-warnings", BL, yes, ParseBool, boolPicks },
{ TidyQuiet, MS, "quiet", BL, no, ParseBool, boolPicks },
{ TidyIndentContent, PP, "indent", IN, TidyNoState, ParseAutoBool, autoBoolPicks },
View
5 src/localize.c
@@ -681,6 +681,9 @@ static const TidyOptionDoc option_docs[] =
"This option specifies the number Tidy uses to determine if further errors "
"should be shown. If set to 0, then no errors are shown. "
},
+ {TidyShowInfo,
+ "This option specifies if Tidy should display info-level messages. "
+ },
{TidyShowWarnings,
"This option specifies if Tidy should suppress warnings. This can be "
"useful when a few errors are hidden in a flurry of warnings. "
@@ -1083,6 +1086,7 @@ __attribute__((format(printf, 2, 3)))
void message( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... )
{
+ if (level == TidyInfo && !cfgBool(doc, TidyShowInfo)) return;
va_list args;
va_start( args, msg );
messagePos( doc, level, 0, 0, msg, args );
@@ -1812,6 +1816,7 @@ void TY_(NeedsAuthorIntervention)( TidyDocImpl* doc )
void TY_(GeneralInfo)( TidyDocImpl* doc )
{
+ if (!cfgBool(doc, TidyShowInfo)) return;
tidy_out(doc, "About this fork of Tidy: http://w3c.github.com/tidy-html5/\n");
tidy_out(doc, "Bug reports and comments: https://github.com/w3c/tidy-html5/issues/\n");
tidy_out(doc, "Or send questions and comments to html-tidy@w3.org\n");
View
2  src/version.h
@@ -1 +1 @@
-static const char TY_(release_date)[] = "https://github.com/w3c/tidy-html5/tree/1f21625";
Please sign in to comment.
Something went wrong with that request. Please try again.