Skip to content

Commit 93957e4

Browse files
authored
Merge pull request #629 from htacg/squelch_reports
Squelch reports
2 parents 6309aba + 6f51ece commit 93957e4

19 files changed

+551
-46
lines changed

include/tidy.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,16 @@ TIDY_EXPORT int TIDY_CALL tidyGetMessageColumn( TidyMessage tmessage );
12481248
** message.
12491249
*/
12501250
TIDY_EXPORT TidyReportLevel TIDY_CALL tidyGetMessageLevel( TidyMessage tmessage );
1251-
1251+
1252+
1253+
/** Get the muted status of the message, that is, whether or not the
1254+
** current configuration indicated that this message should be muted.
1255+
** @param tmessage Specify the message that you are querying.
1256+
** @result Returns a Bool indicating that the config indicates muting this
1257+
** message.
1258+
*/
1259+
TIDY_EXPORT Bool TIDY_CALL tidyGetMessageIsMuted( TidyMessage tmessage );
1260+
12521261
/** Get the default format string, which is the format string for the message
12531262
** in Tidy's default localization (en_us).
12541263
** @param tmessage Specify the message that you are querying.

include/tidyenum.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,9 @@ extern "C" {
157157
** than the short report.
158158
*/
159159
#define FOREACH_DIALOG_MSG(FN) \
160-
/* TidyInfo */ FN(STRING_CONTENT_LOOKS) \
161-
/* TidyInfo */ FN(STRING_DOCTYPE_GIVEN) \
162160
/* TidyDialogueSummary */ FN(STRING_ERROR_COUNT) \
163161
/* TidyDialogueSummary */ FN(STRING_NEEDS_INTERVENTION) \
164162
/* TidyDialogueSummary */ FN(STRING_NO_ERRORS) \
165-
/* TidyInfo */ FN(STRING_NO_SYSID) \
166163
/* TidyDialogueSummary */ FN(STRING_NOT_ALL_SHOWN) \
167164
/* TidyDialogueInfo */ FN(TEXT_GENERAL_INFO_PLEA) \
168165
/* TidyDialogueInfo */ FN(TEXT_GENERAL_INFO)
@@ -255,7 +252,12 @@ extern "C" {
255252
FN(REPLACING_ELEMENT) \
256253
FN(REPLACING_UNEX_ELEMENT) \
257254
FN(SPACE_PRECEDING_XMLDECL) \
255+
FN(STRING_CONTENT_LOOKS) \
256+
FN(STRING_ARGUMENT_BAD) \
257+
FN(STRING_DOCTYPE_GIVEN) \
258258
FN(STRING_MISSING_MALFORMED) \
259+
FN(STRING_MUTING_TYPE) \
260+
FN(STRING_NO_SYSID) \
259261
FN(STRING_UNKNOWN_OPTION) \
260262
FN(SUSPECTED_MISSING_QUOTE) \
261263
FN(TAG_NOT_ALLOWED_IN) \
@@ -636,6 +638,8 @@ typedef enum
636638
TidyShowWarnings, /**< However errors are always shown */
637639
TidySkipNested, /**< Skip nested tags in script and style CDATA */
638640
TidySortAttributes, /**< Sort attributes */
641+
TidyMuteReports, /**< Filter these messages from output. */
642+
TidyMuteShow, /**< Show message ID's in the error table */
639643
TidyStrictTagsAttr, /**< Ensure tags and attributes match output HTML version */
640644
TidyStyleTags, /**< Move sytle to head */
641645
TidyTabSize, /**< Expand tabs to n spaces */
@@ -1414,7 +1418,9 @@ typedef enum
14141418
FOREACH_MSG_MISC(MAKE_ENUM)
14151419
FOREACH_FOOTNOTE_MSG(MAKE_ENUM)
14161420
FOREACH_DIALOG_MSG(MAKE_ENUM)
1421+
REPORT_MESSAGE_FIRST,
14171422
FOREACH_REPORT_MSG(MAKE_ENUM)
1423+
REPORT_MESSAGE_LAST,
14181424
FOREACH_ACCESS_MSG(MAKE_ENUM)
14191425

14201426
#if SUPPORT_CONSOLE_APP

localize/translations/language_en_gb.po

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgstr ""
55
"Plural-Forms: nplurals=2; plural=n != 1;\n"
66
"X-Generator: HTML Tidy poconvert.rb\n"
77
"Project-Id-Version: \n"
8-
"PO-Revision-Date: 2017-10-07 16:24:04\n"
8+
"PO-Revision-Date: 2017-10-10 08:20:36\n"
99
"Last-Translator: jderry\n"
1010
"Language-Team: \n"
1111

@@ -1297,6 +1297,41 @@ msgid ""
12971297
"been output. "
12981298
msgstr ""
12991299

1300+
#. Important notes for translators:
1301+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1302+
#. <br/>.
1303+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1304+
#. - Option values should be enclosed in <var></var>.
1305+
#. - It's very important that <br/> be self-closing!
1306+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1307+
#. be translated.
1308+
msgctxt "TidyMuteReports"
1309+
msgid ""
1310+
"Use this option to prevent Tidy from displaying certain types of "
1311+
"report output,for example, for conditions that you wish to ignore."
1312+
"<br/>"
1313+
"This option takes a list of one or more keys indicating the message "
1314+
"type to mute. You can discover these message keys by using the "
1315+
"<code>mute-id</code> configuration option and examining Tidy's "
1316+
"output. "
1317+
msgstr ""
1318+
1319+
#. Important notes for translators:
1320+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1321+
#. <br/>.
1322+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1323+
#. - Option values should be enclosed in <var></var>.
1324+
#. - It's very important that <br/> be self-closing!
1325+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1326+
#. be translated.
1327+
msgctxt "TidyMuteShow"
1328+
msgid ""
1329+
"This option indicates whether or not Tidy should display message ID's "
1330+
"with each of its error reports. This could be useful if you wanted to "
1331+
"use the <code>mute</code> configuration option in order to filter "
1332+
"out certain report messages. "
1333+
msgstr ""
1334+
13001335
#. Important notes for translators:
13011336
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
13021337
#. <br/>.
@@ -2535,11 +2570,21 @@ msgctxt "SPACE_PRECEDING_XMLDECL"
25352570
msgid "removing whitespace preceding XML Declaration"
25362571
msgstr ""
25372572

2573+
#, c-format
2574+
msgctxt "STRING_ARGUMENT_BAD"
2575+
msgid "option \"%s\" given bad argument \"%s\""
2576+
msgstr ""
2577+
25382578
#, c-format
25392579
msgctxt "STRING_MISSING_MALFORMED"
25402580
msgid "missing or malformed argument for option: %s"
25412581
msgstr ""
25422582

2583+
#, c-format
2584+
msgctxt "STRING_MUTING_TYPE"
2585+
msgid "messages of type \"%s\" will not be output"
2586+
msgstr ""
2587+
25432588
#, c-format
25442589
msgctxt "STRING_UNKNOWN_OPTION"
25452590
msgid "unknown option: %s"

localize/translations/language_es.po

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgstr ""
55
"Plural-Forms: nplurals=2; plural=n != 1;\n"
66
"X-Generator: HTML Tidy poconvert.rb\n"
77
"Project-Id-Version: \n"
8-
"PO-Revision-Date: 2017-10-07 16:24:04\n"
8+
"PO-Revision-Date: 2017-10-10 08:20:36\n"
99
"Last-Translator: jderry\n"
1010
"Language-Team: \n"
1111

@@ -1260,6 +1260,41 @@ msgid ""
12601260
"been output. "
12611261
msgstr ""
12621262

1263+
#. Important notes for translators:
1264+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1265+
#. <br/>.
1266+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1267+
#. - Option values should be enclosed in <var></var>.
1268+
#. - It's very important that <br/> be self-closing!
1269+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1270+
#. be translated.
1271+
msgctxt "TidyMuteReports"
1272+
msgid ""
1273+
"Use this option to prevent Tidy from displaying certain types of "
1274+
"report output,for example, for conditions that you wish to ignore."
1275+
"<br/>"
1276+
"This option takes a list of one or more keys indicating the message "
1277+
"type to mute. You can discover these message keys by using the "
1278+
"<code>mute-id</code> configuration option and examining Tidy's "
1279+
"output. "
1280+
msgstr ""
1281+
1282+
#. Important notes for translators:
1283+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1284+
#. <br/>.
1285+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1286+
#. - Option values should be enclosed in <var></var>.
1287+
#. - It's very important that <br/> be self-closing!
1288+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1289+
#. be translated.
1290+
msgctxt "TidyMuteShow"
1291+
msgid ""
1292+
"This option indicates whether or not Tidy should display message ID's "
1293+
"with each of its error reports. This could be useful if you wanted to "
1294+
"use the <code>mute</code> configuration option in order to filter "
1295+
"out certain report messages. "
1296+
msgstr ""
1297+
12631298
#. Important notes for translators:
12641299
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
12651300
#. <br/>.
@@ -2479,11 +2514,21 @@ msgctxt "SPACE_PRECEDING_XMLDECL"
24792514
msgid "removing whitespace preceding XML Declaration"
24802515
msgstr ""
24812516

2517+
#, c-format
2518+
msgctxt "STRING_ARGUMENT_BAD"
2519+
msgid "option \"%s\" given bad argument \"%s\""
2520+
msgstr ""
2521+
24822522
#, c-format
24832523
msgctxt "STRING_MISSING_MALFORMED"
24842524
msgid "missing or malformed argument for option: %s"
24852525
msgstr ""
24862526

2527+
#, c-format
2528+
msgctxt "STRING_MUTING_TYPE"
2529+
msgid "messages of type \"%s\" will not be output"
2530+
msgstr ""
2531+
24872532
#, c-format
24882533
msgctxt "STRING_UNKNOWN_OPTION"
24892534
msgid "unknown option: %s"

localize/translations/language_es_mx.po

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgstr ""
55
"Plural-Forms: nplurals=2; plural=n != 1;\n"
66
"X-Generator: HTML Tidy poconvert.rb\n"
77
"Project-Id-Version: \n"
8-
"PO-Revision-Date: 2017-10-07 16:24:04\n"
8+
"PO-Revision-Date: 2017-10-10 08:20:36\n"
99
"Last-Translator: jderry\n"
1010
"Language-Team: \n"
1111

@@ -1255,6 +1255,41 @@ msgid ""
12551255
"been output. "
12561256
msgstr ""
12571257

1258+
#. Important notes for translators:
1259+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1260+
#. <br/>.
1261+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1262+
#. - Option values should be enclosed in <var></var>.
1263+
#. - It's very important that <br/> be self-closing!
1264+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1265+
#. be translated.
1266+
msgctxt "TidyMuteReports"
1267+
msgid ""
1268+
"Use this option to prevent Tidy from displaying certain types of "
1269+
"report output,for example, for conditions that you wish to ignore."
1270+
"<br/>"
1271+
"This option takes a list of one or more keys indicating the message "
1272+
"type to mute. You can discover these message keys by using the "
1273+
"<code>mute-id</code> configuration option and examining Tidy's "
1274+
"output. "
1275+
msgstr ""
1276+
1277+
#. Important notes for translators:
1278+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1279+
#. <br/>.
1280+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1281+
#. - Option values should be enclosed in <var></var>.
1282+
#. - It's very important that <br/> be self-closing!
1283+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1284+
#. be translated.
1285+
msgctxt "TidyMuteShow"
1286+
msgid ""
1287+
"This option indicates whether or not Tidy should display message ID's "
1288+
"with each of its error reports. This could be useful if you wanted to "
1289+
"use the <code>mute</code> configuration option in order to filter "
1290+
"out certain report messages. "
1291+
msgstr ""
1292+
12581293
#. Important notes for translators:
12591294
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
12601295
#. <br/>.
@@ -2474,11 +2509,21 @@ msgctxt "SPACE_PRECEDING_XMLDECL"
24742509
msgid "removing whitespace preceding XML Declaration"
24752510
msgstr ""
24762511

2512+
#, c-format
2513+
msgctxt "STRING_ARGUMENT_BAD"
2514+
msgid "option \"%s\" given bad argument \"%s\""
2515+
msgstr ""
2516+
24772517
#, c-format
24782518
msgctxt "STRING_MISSING_MALFORMED"
24792519
msgid "missing or malformed argument for option: %s"
24802520
msgstr ""
24812521

2522+
#, c-format
2523+
msgctxt "STRING_MUTING_TYPE"
2524+
msgid "messages of type \"%s\" will not be output"
2525+
msgstr ""
2526+
24822527
#, c-format
24832528
msgctxt "STRING_UNKNOWN_OPTION"
24842529
msgid "unknown option: %s"

localize/translations/language_fr.po

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgstr ""
55
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
66
"X-Generator: HTML Tidy poconvert.rb\n"
77
"Project-Id-Version: \n"
8-
"PO-Revision-Date: 2017-10-07 16:24:04\n"
8+
"PO-Revision-Date: 2017-10-10 08:20:36\n"
99
"Last-Translator: jderry\n"
1010
"Language-Team: \n"
1111

@@ -1490,6 +1490,41 @@ msgstr ""
14901490
"classement. Si la valeur est <var>alpha</var>, l'algorithme est un classement alphabétique "
14911491
"ascendant. "
14921492

1493+
#. Important notes for translators:
1494+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1495+
#. <br/>.
1496+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1497+
#. - Option values should be enclosed in <var></var>.
1498+
#. - It's very important that <br/> be self-closing!
1499+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1500+
#. be translated.
1501+
msgctxt "TidyMuteReports"
1502+
msgid ""
1503+
"Use this option to prevent Tidy from displaying certain types of "
1504+
"report output,for example, for conditions that you wish to ignore."
1505+
"<br/>"
1506+
"This option takes a list of one or more keys indicating the message "
1507+
"type to mute. You can discover these message keys by using the "
1508+
"<code>mute-id</code> configuration option and examining Tidy's "
1509+
"output. "
1510+
msgstr ""
1511+
1512+
#. Important notes for translators:
1513+
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
1514+
#. <br/>.
1515+
#. - Entities, tags, attributes, etc., should be enclosed in <code></code>.
1516+
#. - Option values should be enclosed in <var></var>.
1517+
#. - It's very important that <br/> be self-closing!
1518+
#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
1519+
#. be translated.
1520+
msgctxt "TidyMuteShow"
1521+
msgid ""
1522+
"This option indicates whether or not Tidy should display message ID's "
1523+
"with each of its error reports. This could be useful if you wanted to "
1524+
"use the <code>mute</code> configuration option in order to filter "
1525+
"out certain report messages. "
1526+
msgstr ""
1527+
14931528
#. Important notes for translators:
14941529
#. - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
14951530
#. <br/>.
@@ -2919,11 +2954,21 @@ msgctxt "SPACE_PRECEDING_XMLDECL"
29192954
msgid "removing whitespace preceding XML Declaration"
29202955
msgstr "suppression de l'espace précédant la déclaration XML"
29212956

2957+
#, c-format
2958+
msgctxt "STRING_ARGUMENT_BAD"
2959+
msgid "option \"%s\" given bad argument \"%s\""
2960+
msgstr ""
2961+
29222962
#, c-format
29232963
msgctxt "STRING_MISSING_MALFORMED"
29242964
msgid "missing or malformed argument for option: %s"
29252965
msgstr "argument manquant ou incorrect pour l'option: %s"
29262966

2967+
#, c-format
2968+
msgctxt "STRING_MUTING_TYPE"
2969+
msgid "messages of type \"%s\" will not be output"
2970+
msgstr ""
2971+
29272972
#, c-format
29282973
msgctxt "STRING_UNKNOWN_OPTION"
29292974
msgid "unknown option: %s"

0 commit comments

Comments
 (0)