File tree 5 files changed +36
-2
lines changed
5 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -2544,8 +2544,8 @@ int main( int argc, char** argv )
2544
2544
}
2545
2545
}
2546
2546
2547
- contentErrors += tidyErrorCount ( tdoc );
2548
- contentWarnings += tidyWarningCount ( tdoc );
2547
+ contentErrors += tidyErrorCount ( tdoc ) - tidyMutedErrorCount ( tdoc ) ;
2548
+ contentWarnings += tidyWarningCount ( tdoc ) - tidyMutedWarningCount ( tdoc ) ;
2549
2549
accessWarnings += tidyAccessWarningCount ( tdoc );
2550
2550
2551
2551
-- argc ;
Original file line number Diff line number Diff line change @@ -444,12 +444,24 @@ TIDY_EXPORT Bool TIDY_CALL tidyDetectedGenericXml( TidyDoc tdoc );
444
444
*/
445
445
TIDY_EXPORT uint TIDY_CALL tidyErrorCount ( TidyDoc tdoc );
446
446
447
+ /** Indicates the number of error messages muted, that won't be output.
448
+ ** @param tdoc An instance of a TidyDoc to query.
449
+ ** @result Returns the number of muted error messages.
450
+ */
451
+ TIDY_EXPORT uint TIDY_CALL tidyMutedErrorCount ( TidyDoc tdoc );
452
+
447
453
/** Indicates the number of TidyWarning messages that were generated.
448
454
** @param tdoc An instance of a TidyDoc to query.
449
455
** @result Returns the number of TidyWarning messages that were generated.
450
456
*/
451
457
TIDY_EXPORT uint TIDY_CALL tidyWarningCount ( TidyDoc tdoc );
452
458
459
+ /** Indicates the number of warning messages muted, that won't be output.
460
+ ** @param tdoc An instance of a TidyDoc to query.
461
+ ** @result Returns the number of muted warning messages.
462
+ */
463
+ TIDY_EXPORT uint TIDY_CALL tidyMutedWarningCount ( TidyDoc tdoc );
464
+
453
465
/** Indicates the number of TidyAccess messages that were generated.
454
466
** @param tdoc An instance of a TidyDoc to query.
455
467
** @result Returns the number of TidyAccess messages that were generated.
Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ static void messageOut( TidyMessageImpl *message )
133
133
break ;
134
134
case TidyWarning :
135
135
doc -> warnings ++ ;
136
+ if ( message -> muted )
137
+ doc -> mutedWarningCount ++ ;
136
138
break ;
137
139
case TidyConfig :
138
140
doc -> optionErrors ++ ;
@@ -142,6 +144,8 @@ static void messageOut( TidyMessageImpl *message )
142
144
break ;
143
145
case TidyError :
144
146
doc -> errors ++ ;
147
+ if ( message -> muted )
148
+ doc -> mutedErrorCount ++ ;
145
149
break ;
146
150
case TidyBadDocument :
147
151
doc -> docErrors ++ ;
Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ struct _TidyDocImpl
65
65
/* Parse + Repair Results */
66
66
uint optionErrors ;
67
67
uint errors ;
68
+ uint mutedErrorCount ;
68
69
uint warnings ;
70
+ uint mutedWarningCount ;
69
71
uint accessErrors ;
70
72
uint infoMessages ;
71
73
uint docErrors ;
Original file line number Diff line number Diff line change @@ -1044,6 +1044,14 @@ uint TIDY_CALL tidyErrorCount( TidyDoc tdoc )
1044
1044
count = impl -> errors ;
1045
1045
return count ;
1046
1046
}
1047
+ uint TIDY_CALL tidyMutedErrorCount ( TidyDoc tdoc )
1048
+ {
1049
+ TidyDocImpl * impl = tidyDocToImpl ( tdoc );
1050
+ uint count = 0xFFFFFFFF ;
1051
+ if ( impl )
1052
+ count = impl -> mutedErrorCount ;
1053
+ return count ;
1054
+ }
1047
1055
uint TIDY_CALL tidyWarningCount ( TidyDoc tdoc )
1048
1056
{
1049
1057
TidyDocImpl * impl = tidyDocToImpl ( tdoc );
@@ -1052,6 +1060,14 @@ uint TIDY_CALL tidyWarningCount( TidyDoc tdoc )
1052
1060
count = impl -> warnings ;
1053
1061
return count ;
1054
1062
}
1063
+ uint TIDY_CALL tidyMutedWarningCount ( TidyDoc tdoc )
1064
+ {
1065
+ TidyDocImpl * impl = tidyDocToImpl ( tdoc );
1066
+ uint count = 0xFFFFFFFF ;
1067
+ if ( impl )
1068
+ count = impl -> mutedWarningCount ;
1069
+ return count ;
1070
+ }
1055
1071
uint TIDY_CALL tidyAccessWarningCount ( TidyDoc tdoc )
1056
1072
{
1057
1073
TidyDocImpl * impl = tidyDocToImpl ( tdoc );
You can’t perform that action at this time.
0 commit comments