Always show DOCTYPE found
This commit is contained in:
parent
a08c7c9444
commit
20da40d2e8
|
@ -1313,9 +1313,18 @@ int main( int argc, char** argv )
|
|||
if ( status >= 0 )
|
||||
status = tidyCleanAndRepair( tdoc );
|
||||
|
||||
if ( status >= 0 )
|
||||
if ( status >= 0 ) {
|
||||
status = tidyRunDiagnostics( tdoc );
|
||||
if ( !tidyOptGetBool(tdoc, TidyQuiet) ) {
|
||||
/* NOT quiet, show DOCTYPE, if not already shown */
|
||||
if (!tidyOptGetBool(tdoc, TidyShowInfo)) {
|
||||
tidyOptSetBool( tdoc, TidyShowInfo, yes );
|
||||
tidyReportDoctype( tdoc ); /* FIX20140913: like warnings, errors, ALWAYS report DOCTYPE */
|
||||
tidyOptSetBool( tdoc, TidyShowInfo, no );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ( status > 1 ) /* If errors, do we want to force output? */
|
||||
status = ( tidyOptGetBool(tdoc, TidyForceOutput) ? status : -1 );
|
||||
|
||||
|
|
|
@ -676,6 +676,8 @@ TIDY_EXPORT int TIDY_CALL tidyCleanAndRepair( TidyDoc tdoc );
|
|||
*/
|
||||
TIDY_EXPORT int TIDY_CALL tidyRunDiagnostics( TidyDoc tdoc );
|
||||
|
||||
TIDY_EXPORT int TIDY_CALL tidyReportDoctype( TidyDoc tdoc );
|
||||
|
||||
/** @} end Clean group */
|
||||
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ static int tidyDocParseSource( TidyDocImpl* impl, TidyInputSource* docI
|
|||
** pre-or-post repair.
|
||||
*/
|
||||
static int tidyDocRunDiagnostics( TidyDocImpl* doc );
|
||||
static void tidyDocReportDoctype( TidyDocImpl* doc );
|
||||
static int tidyDocCleanAndRepair( TidyDocImpl* doc );
|
||||
|
||||
|
||||
|
@ -1136,6 +1137,16 @@ int TIDY_CALL tidyRunDiagnostics( TidyDoc tdoc )
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
int TIDY_CALL tidyReportDoctype( TidyDoc tdoc )
|
||||
{
|
||||
int iret = -EINVAL;
|
||||
TidyDocImpl* impl = tidyDocToImpl( tdoc );
|
||||
if ( impl ) {
|
||||
tidyDocReportDoctype( impl );
|
||||
iret = 0;
|
||||
}
|
||||
return iret;
|
||||
}
|
||||
|
||||
/* Workhorse functions.
|
||||
**
|
||||
|
@ -1228,6 +1239,12 @@ int tidyDocRunDiagnostics( TidyDocImpl* doc )
|
|||
return tidyDocStatus( doc );
|
||||
}
|
||||
|
||||
void tidyDocReportDoctype( TidyDocImpl* doc )
|
||||
{
|
||||
TY_(ReportMarkupVersion)( doc );
|
||||
}
|
||||
|
||||
|
||||
/* ######################################################################################
|
||||
HTML5 STUFF
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue