diff --git a/src/message.c b/src/message.c index 1063300..a60ce67 100755 --- a/src/message.c +++ b/src/message.c @@ -826,54 +826,6 @@ void TY_(ReportUnknownOption)( TidyDocImpl* doc, ctmbstr option ) } -/********************************************************************* - * Legacy High Level Message Writing Functions - Specific - * When adding new reports to LibTidy, preference should be given - * to one of the existing, general pupose message writing functions - * above, if possible, otherwise try to use one of these, or as a - * last resort add a new one in this section. - *********************************************************************/ - - -void TY_(ReportMarkupVersion)( TidyDocImpl* doc ) -{ - TidyMessageImpl *message = NULL; - - if ( doc->givenDoctype ) - { - /* @todo: deal with non-ASCII characters in FPI */ - message = TY_(tidyMessageCreate)( doc, STRING_DOCTYPE_GIVEN, TidyInfo, doc->givenDoctype ); - messageOut(message); - } - - if ( ! cfgBool(doc, TidyXmlTags) ) - { - Bool isXhtml = doc->lexer->isvoyager; - uint apparentVers; - ctmbstr vers; - - apparentVers = TY_(ApparentVersion)( doc ); - - vers = TY_(HTMLVersionNameFromCode)( apparentVers, isXhtml ); - - if ( !vers ) - { - vers = tidyLocalizedString(STRING_HTML_PROPRIETARY); - } - - message = TY_(tidyMessageCreate)( doc, STRING_CONTENT_LOOKS, TidyInfo, vers ); - messageOut(message); - - /* Warn about missing sytem identifier (SI) in emitted doctype */ - if ( TY_(WarnMissingSIInEmittedDocType)( doc ) ) - { - message = TY_(tidyMessageCreate)( doc, STRING_NO_SYSID, TidyInfo); - messageOut(message); - } - } -} - - /********************************************************************* * Output Dialogue Information * In addition to reports that are added to the table, Tidy emits @@ -1045,6 +997,45 @@ void TY_(ErrorSummary)( TidyDocImpl* doc ) } +void TY_(ReportMarkupVersion)( TidyDocImpl* doc ) +{ + TidyMessageImpl *message = NULL; + + if ( doc->givenDoctype ) + { + /* @todo: deal with non-ASCII characters in FPI */ + message = TY_(tidyMessageCreate)( doc, STRING_DOCTYPE_GIVEN, TidyInfo, doc->givenDoctype ); + messageOut(message); + } + + if ( ! cfgBool(doc, TidyXmlTags) ) + { + Bool isXhtml = doc->lexer->isvoyager; + uint apparentVers; + ctmbstr vers; + + apparentVers = TY_(ApparentVersion)( doc ); + + vers = TY_(HTMLVersionNameFromCode)( apparentVers, isXhtml ); + + if ( !vers ) + { + vers = tidyLocalizedString(STRING_HTML_PROPRIETARY); + } + + message = TY_(tidyMessageCreate)( doc, STRING_CONTENT_LOOKS, TidyInfo, vers ); + messageOut(message); + + /* Warn about missing sytem identifier (SI) in emitted doctype */ + if ( TY_(WarnMissingSIInEmittedDocType)( doc ) ) + { + message = TY_(tidyMessageCreate)( doc, STRING_NO_SYSID, TidyInfo); + messageOut(message); + } + } +} + + void TY_(ReportNumWarnings)( TidyDocImpl* doc ) { TidyMessageImpl *message = NULL; diff --git a/src/message.h b/src/message.h index a305233..13dd77a 100644 --- a/src/message.h +++ b/src/message.h @@ -71,9 +71,6 @@ void TY_(ReportUnknownOption)( TidyDocImpl* doc, ctmbstr option ); /** @{ */ -void TY_(ReportMarkupVersion)( TidyDocImpl* doc ); - - #if SUPPORT_ACCESSIBILITY_CHECKS void TY_(ReportAccessError)( TidyDocImpl* doc, Node* node, uint code ); @@ -89,6 +86,7 @@ void TY_(ReportAccessWarning)( TidyDocImpl* doc, Node* node, uint code ); void TY_(DialogueMessage)( TidyDocImpl* doc, uint code, TidyReportLevel level ); void TY_(ErrorSummary)( TidyDocImpl* doc ); +void TY_(ReportMarkupVersion)( TidyDocImpl* doc ); void TY_(ReportNumWarnings)( TidyDocImpl* doc );