From 219a5c797be0f4509a61fdb01b15181f5a518c77 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sun, 9 Apr 2017 02:08:03 +0200 Subject: [PATCH 01/15] Issue #524 - Remove obsolete message --- src/language_en.h | 8 -------- src/message.c | 7 ------- 2 files changed, 15 deletions(-) diff --git a/src/language_en.h b/src/language_en.h index 1af5fa8..d6d1849 100644 --- a/src/language_en.h +++ b/src/language_en.h @@ -1635,14 +1635,6 @@ static languageDefinition language_en = { whichPluralForm_en, { " search stops for the current direction.\n" " TD cells that set the axis attribute are also treated as header cells.\n" }, - {/* This console output should be limited to 78 characters per line. */ - TEXT_WINDOWS_CHARS, 0, - "Characters codes for the Microsoft Windows fonts in the range\n" - "128 - 159 may not be recognized on other platforms. You are\n" - "instead recommended to use named entities, e.g. ™ rather\n" - "than Windows character code 153 (0x2122 in Unicode). Note that\n" - "as of February 1998 few browsers support the new entities.\n" - }, {/* This console output should be limited to 78 characters per line. - %s represents a string-encoding name which may be localized in your language. */ TEXT_VENDOR_CHARS, 0, diff --git a/src/message.c b/src/message.c index bd94bc9..2c5587e 100755 --- a/src/message.c +++ b/src/message.c @@ -757,13 +757,6 @@ void TY_(ErrorSummary)( TidyDocImpl* doc ) if (doc->badChars) { -#if 0 - if ( doc->badChars & WINDOWS_CHARS ) - { - message = TY_(tidyMessageCreate)( doc, TEXT_WINDOWS_CHARS, TidyDialogueDoc); - messagePos(message); - } -#endif if (doc->badChars & BC_VENDOR_SPECIFIC_CHARS) { message = TY_(tidyMessageCreate)( doc, TEXT_VENDOR_CHARS, TidyDialogueDoc, encnam); From 72612b6ca33e1b81ed6c361a0dddadc7e65912d1 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sun, 9 Apr 2017 02:08:58 +0200 Subject: [PATCH 02/15] Issue #524 - Bump to 5.5.14 for this message change --- version.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.txt b/version.txt index 605309b..afdc4d0 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.5.13 -2017.03.31 +5.5.14 +2017.04.09 From a19d271f47f0dfa2e760fa91d290abc034aec17d Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sat, 15 Apr 2017 03:17:16 +0000 Subject: [PATCH 03/15] Add a flag to warn on proprietary attributes This change adds the TidyWarnPropAttrs flag (default=on) that emits a warning every proprietary attribute it finds. --- include/tidyenum.h | 1 + src/config.c | 1 + src/language_en.h | 11 +++++++++++ src/tidylib.c | 5 ++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/tidyenum.h b/include/tidyenum.h index dd148bd..313b1a3 100644 --- a/include/tidyenum.h +++ b/include/tidyenum.h @@ -632,6 +632,7 @@ typedef enum TidyUpperCaseTags, /**< Output tags in upper not lower case */ TidyUseCustomTags, /**< Enable Tidy to use autonomous custom tags */ TidyVertSpace, /**< degree to which markup is spread out vertically */ + TidyWarnPropAttrs, /**< Warns on proprietary attributes */ TidyWord2000, /**< Draconian cleaning for Word2000 */ TidyWrapAsp, /**< Wrap within ASP pseudo elements */ TidyWrapAttVals, /**< Wrap within attribute values */ diff --git a/src/config.c b/src/config.c index 221b475..19dc975 100644 --- a/src/config.c +++ b/src/config.c @@ -322,6 +322,7 @@ static const TidyOptionImpl option_defs[] = { TidyUpperCaseTags, MU, "uppercase-tags", BL, no, ParseBool, boolPicks }, { TidyUseCustomTags, MU, "custom-tags", IN, TidyCustomNo, ParseUseCustomTags,customTagsPicks }, /* 20170309 - Issue #119 */ { TidyVertSpace, PP, "vertical-space", IN, no, ParseAutoBool, autoBoolPicks }, /* #228 - tri option */ + { TidyWarnPropAttrs, MU, "warn-proprietary-attributes", BL, yes, ParseBool, boolPicks }, { TidyWord2000, MU, "word-2000", BL, no, ParseBool, boolPicks }, { TidyWrapAsp, PP, "wrap-asp", BL, yes, ParseBool, boolPicks }, { TidyWrapAttVals, PP, "wrap-attributes", BL, no, ParseBool, boolPicks }, diff --git a/src/language_en.h b/src/language_en.h index d6d1849..f68acb4 100644 --- a/src/language_en.h +++ b/src/language_en.h @@ -1296,6 +1296,17 @@ static languageDefinition language_en = { whichPluralForm_en, { "If set to auto Tidy will eliminate nearly all newline " "characters." }, + {/* Important notes for translators: + - Use only , , , , and +
. + - Entities, tags, attributes, etc., should be enclosed in . + - Option values should be enclosed in . + - It's very important that
be self-closing! + - The strings "Tidy" and "HTML Tidy" are the program name and must not + be translated. */ + TidyWarnPropAttrs, 0, + "This option specifies if Tidy should warn on proprietary attributes." + }, {/* Important notes for translators: - Use only , , , , and
. diff --git a/src/tidylib.c b/src/tidylib.c index 726df24..f324a4d 100755 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -1823,7 +1823,10 @@ void TY_(CheckHTMLTagsAttribsVersions)( TidyDocImpl* doc, Node* node ) attrIsMismatched = check_versions ? TY_(AttributeIsMismatched)(node, attval, doc) : no; /* Let the PROPRIETARY_ATTRIBUTE warning have precedence. */ if ( attrIsProprietary ) - TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE); + { + if ( cfgBool(doc, TidyWarnPropAttrs) ) + TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE); + } else if ( attrIsMismatched ) { TY_(ReportAttrError)(doc, node, attval, attrReportType); From 4066171ea2ea145b7464800f0808ed47c5f793bd Mon Sep 17 00:00:00 2001 From: Laurent Arnoud Date: Tue, 18 Apr 2017 00:21:07 +0200 Subject: [PATCH 04/15] Generate pkgconfig file for tidy --- CMakeLists.txt | 19 +++++++++++++++++-- build/cmake/.gitignore | 1 + build/cmake/cmake-clean.txt | 2 +- tidy.pc.cmake.in | 9 +++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 tidy.pc.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 862ca31..834e8c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required (VERSION 2.8.7) set(LIB_NAME tidy) +set(LIBTIDY_DESCRIPTION "${LIB_NAME} - HTML syntax checker") +set(LIBTIDY_URL "http://www.html-tidy.org") project (${LIB_NAME}) @@ -371,7 +373,7 @@ else () endif () set(CPACK_PACKAGE_NAME "${LIB_NAME}") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${LIB_NAME} - HTML syntax checker") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${LIBTIDY_DESCRIPTION}") set(CPACK_PACKAGE_VENDOR "HTML Tidy Advocacy Community Group") set(CPACK_PACKAGE_CONTACT "maintainer@htacg.org") @@ -387,7 +389,7 @@ set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html" ## debian config set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) -set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.html-tidy.org/") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${LIBTIDY_URL}) #set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc") set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries") set(CPACK_SOURCE_IGNORE_FILES @@ -405,4 +407,17 @@ endif () include(CPack) +# pkg-config +set(INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" CACHE PATH "Installation directory for libraries") +set(INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" CACHE PATH "Installation directory for headers") +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc" + @ONLY + ) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc" + DESTINATION "${INSTALL_LIBDIR}/pkgconfig" + ) + # eof diff --git a/build/cmake/.gitignore b/build/cmake/.gitignore index 2539213..2b83d50 100644 --- a/build/cmake/.gitignore +++ b/build/cmake/.gitignore @@ -30,5 +30,6 @@ _CPack_Packages/* tidy libtidy* tidy1.xsl +tidy.pc *.vcproj diff --git a/build/cmake/cmake-clean.txt b/build/cmake/cmake-clean.txt index 36eb531..c57f3ae 100644 --- a/build/cmake/cmake-clean.txt +++ b/build/cmake/cmake-clean.txt @@ -27,4 +27,4 @@ libtidy.so.5.0.0 tidy.1 _CPack_Packages tidy1.xsl - +tidy.pc diff --git a/tidy.pc.cmake.in b/tidy.pc.cmake.in new file mode 100644 index 0000000..96e7262 --- /dev/null +++ b/tidy.pc.cmake.in @@ -0,0 +1,9 @@ +libdir=@INSTALL_LIBDIR@ +includedir=@INSTALL_INCDIR@ + +Name: @LIB_NAME@ +Description: @LIBTIDY_DESCRIPTION@ +URL: @LIBTIDY_URL@ +Version: @LIBTIDY_VERSION@ +Libs: -L${libdir} -l@LIB_NAME@ +Cflags: -I${includedir} From 87169d89539cb93aaf736660fc8d13c696ace37f Mon Sep 17 00:00:00 2001 From: Alexander Zolotarev Date: Wed, 19 Apr 2017 14:47:27 -1000 Subject: [PATCH 05/15] Correctly process 'bookmarks' in html exported from Google Doc. --- src/gdoc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gdoc.c b/src/gdoc.c index 3205536..50cd9bc 100644 --- a/src/gdoc.c +++ b/src/gdoc.c @@ -115,6 +115,11 @@ static void CleanNode( TidyDocImpl* doc, Node *node ) else if (nodeIsA(child) && !child->content) { AttVal *id = TY_(GetAttrByName)( child, "name" ); + /* Recent Google Docs is using "id" instead of "name" in + ** the exported html. + */ + if (!id) + id = TY_(GetAttrByName)( child, "id" ); if (id) TY_(RepairAttrValue)( doc, child->parent, "id", id->value ); From b03598652ff104bae9aaf802b851d4a3dfad91f9 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Tue, 2 May 2017 19:39:16 +0200 Subject: [PATCH 06/15] Issue #461 - alternative patch for this issue --- src/tags.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/tags.c b/src/tags.c index 50a931f..36a372c 100644 --- a/src/tags.c +++ b/src/tags.c @@ -184,7 +184,7 @@ static Dict tag_defs[] = { TidyTag_BLOCKQUOTE, "blockquote", VERS_ELEM_BLOCKQUOTE, &TY_(W3CAttrsFor_BLOCKQUOTE)[0], (CM_BLOCK), TY_(ParseBlock), NULL }, { TidyTag_BODY, "body", VERS_ELEM_BODY, &TY_(W3CAttrsFor_BODY)[0], (CM_HTML|CM_OPT|CM_OMITST), TY_(ParseBody), NULL }, { TidyTag_BR, "br", VERS_ELEM_BR, &TY_(W3CAttrsFor_BR)[0], (CM_INLINE|CM_EMPTY), TY_(ParseEmpty), NULL }, - { TidyTag_BUTTON, "button", VERS_ELEM_BUTTON, &TY_(W3CAttrsFor_BUTTON)[0], (CM_INLINE), TY_(ParseBlock), NULL }, + { TidyTag_BUTTON, "button", VERS_ELEM_BUTTON, &TY_(W3CAttrsFor_BUTTON)[0], (CM_INLINE), TY_(ParseInline), NULL }, { TidyTag_CAPTION, "caption", VERS_ELEM_CAPTION, &TY_(W3CAttrsFor_CAPTION)[0], (CM_TABLE), TY_(ParseBlock), CheckCaption }, { TidyTag_CENTER, "center", VERS_ELEM_CENTER, &TY_(W3CAttrsFor_CENTER)[0], (CM_BLOCK), TY_(ParseBlock), NULL }, { TidyTag_CITE, "cite", VERS_ELEM_CITE, &TY_(W3CAttrsFor_CITE)[0], (CM_INLINE), TY_(ParseInline), NULL }, @@ -773,9 +773,6 @@ void TY_(AdjustTags)( TidyDocImpl *doc ) { np->parser = TY_(ParseInline); np->model = CM_INLINE; -#if ELEMENT_HASH_LOOKUP - tagsEmptyHash( doc, tags ); -#endif } /*\ @@ -787,9 +784,6 @@ void TY_(AdjustTags)( TidyDocImpl *doc ) if (np) { np->parser = TY_(ParseInline); -#if ELEMENT_HASH_LOOKUP - tagsEmptyHash( doc, tags ); -#endif } /*\ @@ -801,10 +795,24 @@ void TY_(AdjustTags)( TidyDocImpl *doc ) if (np) { np->model |= CM_HEAD; /* add back allowed in head */ -#if ELEMENT_HASH_LOOKUP - tagsEmptyHash( doc, tags ); -#endif } + +/*\ + * Issue #461 + * TidyTag_BUTTON is a block in HTML4, + * whereas it is inline in HTML5 +\*/ + np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON); + if (np) + { + np->parser = TY_(ParseBlock); + } + +#if ELEMENT_HASH_LOOKUP + tagsEmptyHash(doc, tags); /* not sure this is really required, but to be sure */ +#endif + doc->HTML5Mode = no; /* set *NOT* HTML5 mode */ + } Bool TY_(IsHTML5Mode)( TidyDocImpl *doc ) @@ -839,6 +847,16 @@ void TY_(ResetTags)( TidyDocImpl *doc ) { np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */ } + /*\ + * Issue #461 + * TidyTag_BUTTON reset to inline in HTML5 + \*/ + np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON); + if (np) + { + np->parser = TY_(ParseInline); + } + #if ELEMENT_HASH_LOOKUP tagsEmptyHash( doc, tags ); /* not sure this is really required, but to be sure */ #endif @@ -858,7 +876,6 @@ void TY_(FreeTags)( TidyDocImpl* doc ) /* get rid of dangling tag references */ TidyClearMemory( tags, sizeof(TidyTagImpl) ); - doc->HTML5Mode = no; /* reset html5 mode == legacy html4 mode */ } From 3333ca7d6942b270048d76f9fd8729d4d2f5f21e Mon Sep 17 00:00:00 2001 From: Laurent Arnoud Date: Tue, 2 May 2017 20:28:48 +0200 Subject: [PATCH 07/15] Fix pkgconfig install path on package --- CMakeLists.txt | 6 ++---- README/BUILD.md | 8 ++++++++ tidy.pc.cmake.in | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 834e8c4..b459f5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,7 +205,7 @@ if (NOT BIN_INSTALL_DIR) endif () if (NOT INCLUDE_INSTALL_DIR) - set(INCLUDE_INSTALL_DIR include) + set(INCLUDE_INSTALL_DIR include/${LIB_NAME}) endif () # Always build the STATIC library @@ -408,8 +408,6 @@ endif () include(CPack) # pkg-config -set(INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" CACHE PATH "Installation directory for libraries") -set(INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" CACHE PATH "Installation directory for headers") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc" @@ -417,7 +415,7 @@ configure_file( ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc" - DESTINATION "${INSTALL_LIBDIR}/pkgconfig" + DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" ) # eof diff --git a/README/BUILD.md b/README/BUILD.md index 6ae5bbb..e427752 100644 --- a/README/BUILD.md +++ b/README/BUILD.md @@ -40,6 +40,14 @@ If you do **not** need the tidy library built as a 'shared' (DLL) library, then See the `CMakeLists.txt` file for other CMake **options** offered. +## Build the tidy packages + + 1. `cd build/cmake` + + 2. `cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr` + + 3. Unix/OS X: `make package` + ## Build PHP with the tidy-html5 library Due to API changes in the PHP source, `buffio.h` needs to be renamed to `tidybuffio.h` in the file `ext/tidy/tidy.c` in PHP's source. diff --git a/tidy.pc.cmake.in b/tidy.pc.cmake.in index 96e7262..7d819f1 100644 --- a/tidy.pc.cmake.in +++ b/tidy.pc.cmake.in @@ -1,5 +1,7 @@ -libdir=@INSTALL_LIBDIR@ -includedir=@INSTALL_INCDIR@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@LIB_INSTALL_DIR@ +includedir=${prefix}/@INCLUDE_INSTALL_DIR@ Name: @LIB_NAME@ Description: @LIBTIDY_DESCRIPTION@ From 8b2f92f625ed7c0b5d0de6fdf60e1248b7953626 Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Wed, 3 May 2017 16:15:44 -0400 Subject: [PATCH 08/15] Issue #338 occurs because the existing routines assume that any URI with an extension is a file, and so links to TLD's ending with .pl, .au, etc., will cause accessibility warnings. This fix attempts to distinguish between URI's that are likely to be files versus links to domains. --- src/access.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/src/access.c b/src/access.c index f882e8c..7244492 100644 --- a/src/access.c +++ b/src/access.c @@ -131,6 +131,49 @@ static void MetaDataPresent( TidyDocImpl* doc, Node* node ); static void CheckEmbed( TidyDocImpl* doc, Node* node ); static void CheckListUsage( TidyDocImpl* doc, Node* node ); +/* + IsFilePath attempts to determine whether or not the URI indicated + by path is a file rather than a TLD. For example, sample.com.au might + be confused with an audio file. +*/ +static Bool IsFilePath( ctmbstr path ) +{ + const char *p = path; + char c; + typedef enum states { initial, protocol_found, slash_found, file_found } states; + states state = initial; + + while ( ( c = *p++ ) != 0 && state != file_found ) + { + switch ( state ) + { + case initial: + if ( c == ':' ) + state = protocol_found; + break; + + case protocol_found: + if ( c =='/' ) + state = slash_found; + break; + + case slash_found: + if ( c =='/' ) + state = protocol_found; + else + state = file_found; + break; + + default: + break; + } + + } + + return state == file_found || state == initial; +} + + /* GetFileExtension takes a path and returns the extension portion of the path (if any). @@ -163,9 +206,10 @@ static void GetFileExtension( ctmbstr path, tmbchar *ext, uint maxExt ) static Bool IsImage( ctmbstr iType ) { uint i; - - /* Get the file extension */ tmbchar ext[20]; + + if ( !IsFilePath(iType) ) return 0; + GetFileExtension( iType, ext, sizeof(ext) ); /* Compare it to the array of known image file extensions */ @@ -190,8 +234,11 @@ static int IsSoundFile( ctmbstr sType ) { uint i; tmbchar ext[ 20 ]; - GetFileExtension( sType, ext, sizeof(ext) ); + if ( !IsFilePath(sType) ) return 0; + + GetFileExtension( sType, ext, sizeof(ext) ); + for (i = 0; i < N_AUDIO_EXTS; i++) { if ( TY_(tmbstrcasecmp)(ext, soundExtensions[i]) == 0 ) @@ -215,6 +262,9 @@ static Bool IsValidSrcExtension( ctmbstr sType ) { uint i; tmbchar ext[20]; + + if ( !IsFilePath(sType) ) return 0; + GetFileExtension( sType, ext, sizeof(ext) ); for (i = 0; i < N_FRAME_EXTS; i++) @@ -237,6 +287,9 @@ static Bool IsValidMediaExtension( ctmbstr sType ) { uint i; tmbchar ext[20]; + + if ( !IsFilePath(sType) ) return 0; + GetFileExtension( sType, ext, sizeof(ext) ); for (i = 0; i < N_MEDIA_EXTS; i++) From 14f5980117d7aab655b8be9b2903954254c251bb Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Thu, 4 May 2017 09:50:36 -0400 Subject: [PATCH 09/15] macOS fixes. --- CMakeLists.txt | 2 +- build/cmake/.gitignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b459f5f..d3a7f0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -365,7 +365,7 @@ if (WIN32) set(CPACK_SOURCE_GENERATOR "ZIP") set(CPACK_WIX_UPGRADE_GUID "D809598A-B513-4752-B268-0BAC403B00E4") elseif ( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" ) - set(CPACK_GENERATOR "PackageMake") + set(CPACK_GENERATOR "productbuild") set(CPACK_SOURCE_GENERATOR "TGZ") else () set(CPACK_GENERATOR "DEB;RPM") diff --git a/build/cmake/.gitignore b/build/cmake/.gitignore index 2b83d50..23b5a7b 100644 --- a/build/cmake/.gitignore +++ b/build/cmake/.gitignore @@ -32,4 +32,4 @@ libtidy* tidy1.xsl tidy.pc *.vcproj - +.pkg From d142527a8ebc23f800ad9c6df976ca49b447e31e Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 4 May 2017 17:36:39 +0200 Subject: [PATCH 10/15] Issue #338 - Deal with two other spurious access warnings --- src/access.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/access.c b/src/access.c index 7244492..ac3b9aa 100644 --- a/src/access.c +++ b/src/access.c @@ -2761,6 +2761,10 @@ static Bool CheckMetaData( TidyDocImpl* doc, Node* node, Bool HasMetaData ) TY_(ReportAccessError)( doc, node, REMOVE_AUTO_REDIRECT); } } + if (TY_(IsHTML5Mode)(doc) && attrIsCHARSET(av) && hasValue(av)) + { + ContainsAttr = yes; + } } if ( HasContent || HasHttpEquiv ) @@ -2840,9 +2844,17 @@ static void CheckDocType( TidyDocImpl* doc ) if (DTnode && DTnode->end != 0) { ctmbstr word = textFromOneNode( doc, DTnode); - if ((strstr (word, "HTML PUBLIC") == NULL) && - (strstr (word, "html PUBLIC") == NULL)) - DTnode = NULL; + if (TY_(IsHTML5Mode)(doc)) + { + if ((strstr(word, "HTML") == NULL) && + (strstr(word, "html") == NULL)) + DTnode = NULL; + } + else { + if ((strstr(word, "HTML PUBLIC") == NULL) && + (strstr(word, "html PUBLIC") == NULL)) + DTnode = NULL; + } } if (!DTnode) TY_(ReportAccessError)( doc, &doc->root, DOCTYPE_MISSING); From 846b3cde55cfe6a36c1f959d511cf0585276db8c Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Thu, 4 May 2017 13:45:06 -0400 Subject: [PATCH 11/15] Address #436 just to close it. --- src/language_en.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/language_en.h b/src/language_en.h index d6d1849..8acc8ca 100644 --- a/src/language_en.h +++ b/src/language_en.h @@ -1202,10 +1202,10 @@ static languageDefinition language_en = { whichPluralForm_en, { be translated. */ TidyStrictTagsAttr, 0, "This options ensures that tags and attributes are applicable for the " - "version of HTML that Tidy outputs. When set to yes (the " - "default) and the output document type is a strict doctype, then Tidy " - "will report errors. If the output document type is a loose or " - "transitional doctype, then Tidy will report warnings. " + "version of HTML that Tidy outputs. When set to yes and the " + "output document type is a strict doctype, then Tidy will report " + "errors. If the output document type is a loose or transitional " + "doctype, then Tidy will report warnings. " "
" "Additionally if drop-proprietary-attributes is enabled, " "then not applicable attributes will be dropped, too. " From f9edab1c339b943d70da56c57d1d0c28662dcc0b Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sat, 6 May 2017 14:21:13 +0200 Subject: [PATCH 12/15] Merge #540 - Bump to 5.5.15 - closes #461 --- version.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.txt b/version.txt index afdc4d0..e8c72c1 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.5.14 -2017.04.09 +5.5.15 +2017.05.06 From 594275712c91d3ae0879f9ff3b7dd24cf8a011a7 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sat, 6 May 2017 14:51:19 +0200 Subject: [PATCH 13/15] Merge #532 - Bump to version 5.5.16 for new 'warn-proprietary-attributes' --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index e8c72c1..f24565c 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.5.15 +5.5.16 2017.05.06 From 1257a4982352826b414dd4a470fca9292cb55f3e Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sat, 6 May 2017 15:26:09 +0200 Subject: [PATCH 14/15] Merge #541 - Bump to 5.5.17 - Closes #338 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index f24565c..a4481c0 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.5.16 +5.5.17 2017.05.06 From 61d19c9a869795e0e1cd8b7259484ad79a8cea06 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sat, 6 May 2017 15:37:56 +0200 Subject: [PATCH 15/15] Merge #537 - Bump 5.5.18 for this gdoc fix --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index a4481c0..ed2e779 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.5.17 +5.5.18 2017.05.06