diff --git a/CMakeLists.txt b/CMakeLists.txt index b3e0ba2..eb22e03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,19 @@ if (MSVC) list(APPEND LIBHFILES ${SRCDIR}/sprtf.h) endif () ####################################### + +if (NOT LIB_INSTALL_DIR) + set(LIB_INSTALL_DIR lib${LIB_SUFFIX}) +endif () + +if (NOT BIN_INSTALL_DIR) + set(BIN_INSTALL_DIR bin) +endif () + +if (NOT INCLUDE_INSTALL_DIR) + set(INCLUDE_INSTALL_DIR include) +endif () + # Always build the STATIC library set(name tidy-static) add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} ) @@ -146,11 +159,11 @@ set_target_properties( ${name} PROPERTIES ) list ( APPEND add_LIBS ${name} ) install(TARGETS ${name} - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} ) -install( FILES ${HFILES} DESTINATION include ) +install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} ) ######################################## # if user option still on if (BUILD_SHARED_LIB) @@ -166,11 +179,11 @@ if (BUILD_SHARED_LIB) set_target_properties( ${name} PROPERTIES COMPILE_FLAGS "-DBUILDING_SHARED_LIB" ) install(TARGETS ${name} - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} ) -endif () +endif () ########################################################## ### main executable - linked with STATIC library diff --git a/console/tidy.c b/console/tidy.c index d3563af..bb9e823 100644 --- a/console/tidy.c +++ b/console/tidy.c @@ -1100,6 +1100,7 @@ int main( int argc, char** argv ) tidyOptSetBool( tdoc, TidyQuiet, yes ); else if ( strcasecmp(arg, "help") == 0 || + strcasecmp(arg, "-help") == 0 || strcasecmp(arg, "h") == 0 || *arg == '?' ) { help( prog ); diff --git a/include/tidyenum.h b/include/tidyenum.h index 643284b..3ef0298 100644 --- a/include/tidyenum.h +++ b/include/tidyenum.h @@ -802,16 +802,6 @@ typedef enum /* MathML attributes */ TidyAttr_DISPLAY, /**< DISPLAY= (html5) */ - /* RDFa global attributes */ - TidyAttr_ABOUT, /**< ABOUT= */ - TidyAttr_DATATYPE, /**< DATATYPE= */ - TidyAttr_INLIST, /**< INLIST= */ - TidyAttr_PREFIX, /**< PREFIX= */ - TidyAttr_PROPERTY, /**< PROPERTY= */ - TidyAttr_RESOURCE, /**< RESOURCE= */ - TidyAttr_TYPEOF, /**< TYPEOF= */ - TidyAttr_VOCAB, /**< VOCAB= */ - N_TIDY_ATTRIBS /**< Must be last */ } TidyAttrId; diff --git a/src/attrs.c b/src/attrs.c index 3e67889..a2b5ccf 100644 --- a/src/attrs.c +++ b/src/attrs.c @@ -47,9 +47,6 @@ static AttrCheck CheckScroll; static AttrCheck CheckTextDir; static AttrCheck CheckLang; static AttrCheck CheckType; -static AttrCheck CheckRDFaSafeCURIE; -static AttrCheck CheckRDFaTerm; -static AttrCheck CheckRDFaPrefix; #define CH_PCDATA NULL #define CH_CHARSET NULL @@ -88,11 +85,6 @@ static AttrCheck CheckRDFaPrefix; #define CH_TARGET CheckTarget #define CH_VTYPE CheckVType #define CH_ACTION CheckAction -#define CH_RDFAPREFIX CheckRDFaPrefix -#define CH_RDFASCURIE CheckRDFaSafeCURIE -#define CH_RDFASCURIES CheckRDFaSafeCURIE -#define CH_RDFATERM CheckRDFaTerm -#define CH_RDFATERMS CheckRDFaTerm static const Attribute attribute_defs [] = { @@ -425,16 +417,6 @@ static const Attribute attribute_defs [] = #endif { TidyAttr_DISPLAY, "display", CH_PCDATA }, /* on MATH tag (html5) */ - /* RDFa Attributes */ - { TidyAttr_ABOUT, "about", CH_RDFASCURIE }, - { TidyAttr_DATATYPE, "datatype", CH_RDFATERM }, - { TidyAttr_INLIST, "inlist", CH_BOOL }, - { TidyAttr_PREFIX, "prefix", CH_RDFAPREFIX }, - { TidyAttr_PROPERTY, "property", CH_RDFATERMS }, - { TidyAttr_RESOURCE, "resource", CH_RDFASCURIE }, - { TidyAttr_TYPEOF, "typeof", CH_RDFATERMS }, - { TidyAttr_VOCAB, "vocab", CH_URL }, - /* this must be the final entry */ { N_TIDY_ATTRIBS, NULL, NULL } }; @@ -450,32 +432,6 @@ static uint AttributeVersions(Node* node, AttVal* attval) return (XH50 | HT50); if (strcmp(attval->attribute,"allowfullscreen") == 0) return (XH50 | HT50); - /* RDFa global attributes */ - if (strcmp(attval->attribute,"about") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"datatype") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"inlist") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"prefix") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"property") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"resource") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"typeof") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"vocab") == 0) - return (XH50 | HT50); - /* Override the settings on these attributes because - * they are allowed everywhere by RDFa */ - if (strcmp(attval->attribute,"content") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"rel") == 0) - return (XH50 | HT50); - if (strcmp(attval->attribute,"rev") == 0) - return (XH50 | HT50); - } /* TODO: maybe this should return VERS_PROPRIETARY instead? */ if (!attval || !attval->dict) @@ -2197,97 +2153,6 @@ AttVal *SortAttVal( AttVal *list, TidyAttrSortStrategy strat) } } -/* RDFA support checkers - * - */ - -/* CheckRDFAPrefix - ensure the prefix attribute value is - * correct - * - * @prefix takes prefix value pairs in the form: - * - * NCName ':' ' '+ AnyURI - */ - -void CheckRDFaPrefix ( TidyDocImpl* doc, Node *node, AttVal *attval) -{ - if (!AttrHasValue(attval)) - { - TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE); - return; - } - - /* Copy the attribute value so we can split it */ - if (attval->value) { - uint prefixCount = 0; - /* isPrefix toggles - start at 1 and change to 0 as we - * iterate over the components of the value */ - uint isPrefix = 1; - - /* Copy it over */ - - uint len = TY_(tmbstrlen)(attval->value); - tmbstr s = (tmbstr) TidyDocAlloc( doc, len ); - s[0] = '\0'; - TY_(tmbstrcpy)( s, attval->value ); - - /* iterate over value */ - tmbstr tPtr = s; - - tmbstr t; - while ( ( t = strtok(tPtr, " ") ) != NULL ) { - tPtr = NULL; - if (isPrefix) { - /* this piece should be a prefix */ - /* prefix rules are that it can have any - * character except a colon - that one must be - * at the end */ - tmbstr i = index(t, ':') ; - if (i == NULL) { - /* no colon - bad! */ - TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE); - } else if (i != ( t + TY_(tmbstrlen)(t) - 1) ) { - /* not at the end - also bad */ - TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE); - } - } else { - /* this piece should be a URL */ - prefixCount ++; - } - isPrefix = !isPrefix; - } - TidyDocFree( doc, s ) ; - } -} - -/* CheckRDFaTerm - are terms valid - * - */ - -void CheckRDFaTerm ( TidyDocImpl* doc, Node *node, AttVal *attval) -{ - if (!AttrHasValue(attval)) - { - TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE); - return; - } - -} - -/* CheckRDFaSafeCURIE - is a CURIE legal - * - */ - -void CheckRDFaSafeCURIE ( TidyDocImpl* doc, Node *node, AttVal *attval) -{ - if (!AttrHasValue(attval)) - { - TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE); - return; - } - -} - /* * local variables: * mode: c diff --git a/src/attrs.h b/src/attrs.h index c01bd44..2a70faf 100644 --- a/src/attrs.h +++ b/src/attrs.h @@ -12,7 +12,6 @@ /* declaration for methods that check attribute values */ typedef void (AttrCheck)(TidyDocImpl* doc, Node *node, AttVal *attval); -typedef void (AttrCheckEx)(TidyDocImpl* doc, Node *node, AttVal *attval, uint limit); struct _Attribute { diff --git a/src/config.c b/src/config.c index fc67eb1..2ce42cb 100644 --- a/src/config.c +++ b/src/config.c @@ -929,7 +929,10 @@ Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval TidyBuffer inbuf; /* Set up input source */ tidyBufInitWithAllocator( &inbuf, doc->allocator ); tidyBufAttach( &inbuf, (byte*)optval, TY_(tmbstrlen)(optval)+1 ); - doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, ASCII ); + if (optId == TidyOutFile) + doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, RAW ); + else + doc->config.cfgIn = TY_(BufferInput)( doc, &inbuf, ASCII ); doc->config.c = GetC( &doc->config ); status = option->parser( doc, option ); diff --git a/test/input/cfg_1642186-1.txt b/test/input/cfg_1642186-1.txt index fbda861..0cd0e04 100644 --- a/test/input/cfg_1642186-1.txt +++ b/test/input/cfg_1642186-1.txt @@ -1,4 +1,5 @@ -skip-quotes: yes +// not really required since this is defaul +skip-nested: yes indent: auto tidy-mark: no clean: yes diff --git a/test/input/cfg_443576.txt b/test/input/cfg_443576.txt new file mode 100644 index 0000000..2db0343 --- /dev/null +++ b/test/input/cfg_443576.txt @@ -0,0 +1,9 @@ +// now that skip-nested defaults to 'on', need it off for this test +skip-nested: no +// plus default HTML Tidy configuration - 20150219 +indent: auto +char-encoding: latin1 +tidy-mark: no +clean: yes +logical-emphasis: yes +indent-attributes: yes diff --git a/test/testbase/msg_1053626.txt b/test/testbase/msg_1053626.txt index 2733f40..c9d12e0 100644 --- a/test/testbase/msg_1053626.txt +++ b/test/testbase/msg_1053626.txt @@ -23,10 +23,6 @@ a meaningful context for each cell. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_1055304.txt b/test/testbase/msg_1055304.txt index a4939ff..48ce5fa 100644 --- a/test/testbase/msg_1055304.txt +++ b/test/testbase/msg_1055304.txt @@ -11,10 +11,6 @@ to set up and provide immediate feedback to users. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_1098012.txt b/test/testbase/msg_1098012.txt index 6a06a60..c9693ab 100644 --- a/test/testbase/msg_1098012.txt +++ b/test/testbase/msg_1098012.txt @@ -23,10 +23,6 @@ a meaningful context for each cell. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_1316307-2.txt b/test/testbase/msg_1316307-2.txt index 664c904..3a0d1f1 100644 --- a/test/testbase/msg_1316307-2.txt +++ b/test/testbase/msg_1316307-2.txt @@ -17,10 +17,6 @@ a meaningful context for each cell. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_1331849.txt b/test/testbase/msg_1331849.txt index dcd6434..f5cc75d 100644 --- a/test/testbase/msg_1331849.txt +++ b/test/testbase/msg_1331849.txt @@ -17,10 +17,6 @@ a meaningful context for each cell. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_2046048.txt b/test/testbase/msg_2046048.txt index 34f9ef4..3f5c0c8 100644 --- a/test/testbase/msg_2046048.txt +++ b/test/testbase/msg_2046048.txt @@ -35,11 +35,7 @@ This document has errors that must be fixed before using HTML Tidy to generate a tidied up version. For further advice on how to make your pages accessible -see http://www.w3.org/WAI/GL and http://www.aprompt.ca/Tidy/accessibilitychecks.html. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - +see http://www.w3.org/WAI/GL and http://www.html-tidy.org/accessibility/. About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_426885.txt b/test/testbase/msg_426885.txt index edb80aa..39e3058 100644 --- a/test/testbase/msg_426885.txt +++ b/test/testbase/msg_426885.txt @@ -26,10 +26,6 @@ These measures are needed for people using non-graphical browsers. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_427836.txt b/test/testbase/msg_427836.txt index b6b22fb..4e8cd39 100644 --- a/test/testbase/msg_427836.txt +++ b/test/testbase/msg_427836.txt @@ -23,10 +23,6 @@ These measures are needed for people using non-graphical browsers. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_431889.txt b/test/testbase/msg_431889.txt index 35e85e8..3940bd9 100644 --- a/test/testbase/msg_431889.txt +++ b/test/testbase/msg_431889.txt @@ -10,10 +10,6 @@ These measures are needed for people using non-graphical browsers. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_443576.txt b/test/testbase/msg_443576.txt index 289b854..ef4c148 100644 --- a/test/testbase/msg_443576.txt +++ b/test/testbase/msg_443576.txt @@ -1,5 +1,5 @@ line 1 column 1 - Warning: missing declaration -line 8 column 31 - Warning: '<' + '/' + letter not allowed here +line 10 column 1 - Warning: discarding unexpected Info: Document content looks like HTML5 2 warnings, 0 errors were found! diff --git a/test/testbase/msg_443678.txt b/test/testbase/msg_443678.txt index 52435cc..14eb869 100644 --- a/test/testbase/msg_443678.txt +++ b/test/testbase/msg_443678.txt @@ -1,8 +1,7 @@ line 1 column 1 - Warning: missing declaration -line 7 column 28 - Warning: '<' + '/' + letter not allowed here line 11 column 1 - Warning: missing Info: Document content looks like HTML5 -3 warnings, 0 errors were found! +2 warnings, 0 errors were found! You are recommended to use CSS to specify page and link colors About HTML Tidy: https://github.com/htacg/tidy-html5 diff --git a/test/testbase/msg_588061.txt b/test/testbase/msg_588061.txt index 94a55d9..b55bd11 100644 --- a/test/testbase/msg_588061.txt +++ b/test/testbase/msg_588061.txt @@ -115,10 +115,6 @@ These measures are needed for people using non-graphical browsers. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - You are recommended to use CSS to specify the font and properties such as its size and color. This will reduce the size of HTML files and make them easier to maintain diff --git a/test/testbase/msg_676205.txt b/test/testbase/msg_676205.txt index 0ce5fc9..a245e57 100644 --- a/test/testbase/msg_676205.txt +++ b/test/testbase/msg_676205.txt @@ -24,10 +24,6 @@ These measures are needed for people using non-graphical browsers. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/msg_678268.txt b/test/testbase/msg_678268.txt index 1ced44c..d486270 100644 --- a/test/testbase/msg_678268.txt +++ b/test/testbase/msg_678268.txt @@ -17,10 +17,6 @@ a meaningful context for each cell. For further advice on how to make your pages accessible see http://www.w3.org/WAI/GL. -. You may also want to try -"http://www.cast.org/bobby/" which is a free Web-based -service for checking URLs for accessibility. - About HTML Tidy: https://github.com/htacg/tidy-html5 Bug reports and comments: https://github.com/htacg/tidy-html5/issues Or send questions and comments to: https://lists.w3.org/Archives/Public/public-htacg/ diff --git a/test/testbase/out_500236.html b/test/testbase/out_500236.html index 5267e55..144f421 100644 --- a/test/testbase/out_500236.html +++ b/test/testbase/out_500236.html @@ -1,5 +1,5 @@ - - - - + + + + diff --git a/test/testbase/out_661606.html b/test/testbase/out_661606.html index a5e20eb..cdfff15 100644 Binary files a/test/testbase/out_661606.html and b/test/testbase/out_661606.html differ diff --git a/version.txt b/version.txt index 54bc0da..d4c2355 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.1.20 -2015.11.05 +5.1.21 +2015.11.14