From 713e4aab8c2e36051734b2406e67b9fb34fba98d Mon Sep 17 00:00:00 2001 From: Caleb Callaway Date: Mon, 23 Nov 2020 20:29:20 -0800 Subject: [PATCH] Trim trailing whitespace No code changes here, just a quality-of-life edit per htacg#903 --- CMakeLists.txt | 60 +++--- README.md | 8 +- README/ATTRIBUTES.md | 4 +- README/BUILD.md | 16 +- README/CONTRIBUTING.md | 8 +- README/LICENSE.md | 8 +- README/LICENSE.txt | 8 +- README/LOCALIZE.md | 4 +- README/MESSAGES.md | 8 +- README/OPTIONS.md | 4 +- README/RELEASE.md | 10 +- README/TAGS.md | 2 +- README/VERSION.md | 4 +- build/cmake/pub-bins.sh | 8 +- console/tab2space.c | 10 +- console/test71.cxx | 2 +- console/tidy.c | 48 ++--- experimental/TidyNodeIter.c | 2 +- experimental/TidyNodeIter.h | 10 +- experimental/httpio.c | 10 +- include/buffio.h | 2 +- include/platform.h | 2 +- include/tidy.h | 98 ++++----- include/tidybuffio.h | 4 +- include/tidyenum.h | 30 +-- include/tidyplatform.h | 10 +- localize/README.md | 22 +- localize/language_ll_cc.h.erb | 4 +- man/.gitignore | 2 +- man/tidy1.xsl.in | 32 +-- src/access.c | 368 +++++++++++++++++----------------- src/access.h | 12 +- src/attrdict.c | 266 ++++++++++++------------ src/attrs.c | 132 ++++++------ src/buffio.c | 2 +- src/clean.c | 32 +-- src/config.c | 36 ++-- src/config.h | 4 +- src/entities.c | 12 +- src/fileio.h | 2 +- src/forward.h | 2 +- src/gdoc.c | 8 +- src/istack.c | 6 +- src/language.c | 72 +++---- src/language.h | 8 +- src/language_en.h | 28 +-- src/language_en_gb.h | 24 +-- src/language_es.h | 14 +- src/language_es_mx.h | 6 +- src/language_fr.h | 240 +++++++++++----------- src/language_pt_br.h | 262 ++++++++++++------------ src/language_zh_cn.h | 4 +- src/lexer.c | 138 ++++++------- src/lexer.h | 6 +- src/message.c | 54 ++--- src/message.h | 16 +- src/messageobj.c | 68 +++---- src/parser.c | 148 +++++++------- src/pprint.c | 76 +++---- src/pprint.h | 12 +- src/sprtf.c | 4 +- src/streamio.c | 60 +++--- src/streamio.h | 6 +- src/tags.c | 22 +- src/tidy-int.h | 6 +- src/tidylib.c | 26 +-- src/tmbstr.c | 2 +- src/utf8.c | 50 ++--- test.html | 19 ++ 69 files changed, 1356 insertions(+), 1337 deletions(-) create mode 100644 test.html diff --git a/CMakeLists.txt b/CMakeLists.txt index 6acfd72ee..0cd3d4081 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,8 +56,8 @@ if (LIBTIDY_VERSION) list(GET VERSION_LIST 2 TIDY_POINT_VERSION) else () message(FATAL_ERROR "*** FAILED to get a VERSION from version.txt!") -endif () - +endif () + # Establish version date if (LIBTIDY_DATE) string(REPLACE "." ";" DATE_LIST ${LIBTIDY_DATE}) @@ -145,24 +145,24 @@ option( ENABLE_MEMORY_DEBUG "Set ON to output some memory diagnostics." OFF if ( ENABLE_DEBUG_LOG ) add_definitions( -DENABLE_DEBUG_LOG ) - message(STATUS "*** Debug Logging is enabled.") + message(STATUS "*** Debug Logging is enabled.") else () - message(STATUS "*** Debug Logging is NOT enabled.") + message(STATUS "*** Debug Logging is NOT enabled.") endif () if (ENABLE_ALLOC_DEBUG) add_definitions ( -DDEBUG_ALLOCATION ) # see lexer.c for details message(STATUS "*** Note, lexer.c node allocation diagnostics are ON") endif () - + if (ENABLE_MEMORY_DEBUG) add_definitions ( -DDEBUG_MEMORY ) # see alloc.c for details message(STATUS "*** Note, alloc.c memory diagnostics are ON") endif () - + if (WIN32) option( ENABLE_CRTDBG_MEMORY "Set ON to enable the Windows CRT debug library." OFF ) - + if (ENABLE_CRTDBG_MEMORY) add_definitions ( -D_CRTDBG_MAP_ALLOC ) # see tidy.c for details message(STATUS "*** Note, tidy.c Windows CRT memory debug is ON") @@ -178,9 +178,9 @@ if(CMAKE_COMPILER_IS_GNUCXX) set( WARNING_FLAGS -Wall ) endif(CMAKE_COMPILER_IS_GNUCXX) -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set( WARNING_FLAGS "-Wall -Wno-overloaded-virtual" ) -endif() +endif() if(WIN32 AND MSVC) # C4996: The compiler encountered a deprecated declaration. @@ -190,7 +190,7 @@ if(WIN32 AND MSVC) foreach(warning 4996 4090 4244 4267) set(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}") endforeach() - + set( MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS" ) # to distinguish between debug and release lib in windows @@ -206,7 +206,7 @@ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}" ) #------------------------------------------------------------------------ # Static Windows Runtime -# Option to statically link to the Windows runtime. Maybe only +# Option to statically link to the Windows runtime. Maybe only # applies to WIN32/MSVC. #------------------------------------------------------------------------ if (MSVC) @@ -222,7 +222,7 @@ if (MSVC) ) foreach(CompilerFlag ${CompilerFlags}) string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") - endforeach() + endforeach() message(STATUS "Using /MT STATIC runtime") else () message(STATUS "Using /MD DYNAMIC runtime") @@ -255,14 +255,14 @@ if (NO_ACCESS_SUPPORT) endif () # Delete me? Not used in Tidy source! -add_definitions ( -DHAVE_CONFIG_H ) +add_definitions ( -DHAVE_CONFIG_H ) #------------------------------------------------------------------------ # Runtime Configuration File Support # By default on Unix-like systems when building for the console program, # support runtime configuration files in /etc/ and in ~/. To prevent this, -# set ENABLE_CONFIG_FILES to NO. Specify -DTIDY_CONFIG_FILE and/or +# set ENABLE_CONFIG_FILES to NO. Specify -DTIDY_CONFIG_FILE and/or # -DTIDY_USER_CONFIG_FILE to override the default paths in tidyplatform.h. # @note: this section refactored to support #584. #------------------------------------------------------------------------ @@ -276,11 +276,11 @@ if ( UNIX AND SUPPORT_CONSOLE_APP ) else () option ( ENABLE_CONFIG_FILES "Set to ON to enable Tidy runtime configuration file support" OFF ) - + if ( SUPPORT_GETPWNAM ) add_definitions( -DSUPPORT_GETPWNAM=1 ) endif () - + endif () if ( ENABLE_CONFIG_FILES ) @@ -288,7 +288,7 @@ if ( ENABLE_CONFIG_FILES ) message(STATUS "*** Building support for runtime configuration files.") add_definitions( -DTIDY_ENABLE_CONFIG_FILES ) - + # define a default here so we can pass to XSL. if ( NOT TIDY_CONFIG_FILE ) set( TIDY_CONFIG_FILE "/etc/tidy.conf" ) @@ -304,7 +304,7 @@ if ( ENABLE_CONFIG_FILES ) add_definitions( -DTIDY_USER_CONFIG_FILE="${TIDY_USER_CONFIG_FILE}" ) endif () - + #------------------------------------------------------------------------ # Shared Library @@ -341,7 +341,7 @@ set ( CFILES ${SRCDIR}/tmbstr.c ${SRCDIR}/utf8.c ${SRCDIR}/tidylib.c ${SRCDIR}/mappedio.c ${SRCDIR}/gdoc.c ${SRCDIR}/language.c ${SRCDIR}/messageobj.c ${SRCDIR}/sprtf.c ) - + set ( HFILES ${INCDIR}/tidyplatform.h ${INCDIR}/tidy.h ${INCDIR}/tidyenum.h ${INCDIR}/tidybuffio.h ) @@ -359,7 +359,7 @@ set ( LIBHFILES ${SRCDIR}/tmbstr.h ${SRCDIR}/utf8.h ${SRCDIR}/tidy-int.h ${SRCDIR}/version.h ${SRCDIR}/gdoc.h ${SRCDIR}/language.h ${SRCDIR}/language_en.h ${SRCDIR}/sprtf.h ) - + #------------------------------------------------------------------------ # Target Locations @@ -383,11 +383,11 @@ endif () #------------------------------------------------------------------------ set(name tidy-static) add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} ) -set_target_properties( ${name} PROPERTIES +set_target_properties( ${name} PROPERTIES OUTPUT_NAME ${LIB_NAME}s ) if (NOT TIDY_CONSOLE_SHARED) # user wants default static linkage list ( APPEND add_LIBS ${name} ) -endif () +endif () install(TARGETS ${name} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} @@ -410,12 +410,12 @@ if (BUILD_SHARED_LIB) set(CMAKE_MACOSX_RPATH 1) endif () add_library ( ${name} SHARED ${CFILES} ${HFILES} ${LIBHFILES} ) - set_target_properties( ${name} PROPERTIES + set_target_properties( ${name} PROPERTIES OUTPUT_NAME ${LIB_NAME} ) set_target_properties( ${name} PROPERTIES VERSION ${LIBTIDY_VERSION} SOVERSION ${TIDY_MAJOR_VERSION} ) - set_target_properties( ${name} PROPERTIES + set_target_properties( ${name} PROPERTIES COMPILE_FLAGS "-DBUILD_SHARED_LIB -DBUILDING_SHARED_LIB") install(TARGETS ${name} RUNTIME DESTINATION ${BIN_INSTALL_DIR} @@ -424,7 +424,7 @@ if (BUILD_SHARED_LIB) ) if (TIDY_CONSOLE_SHARED) # user wants shared/dll linkage list ( APPEND add_LIBS ${name} ) - endif () + endif () endif () @@ -442,7 +442,7 @@ if (SUPPORT_CONSOLE_APP) set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d ) endif () if (NOT TIDY_CONSOLE_SHARED) - set_target_properties( ${name} PROPERTIES + set_target_properties( ${name} PROPERTIES COMPILE_FLAGS "-DTIDY_STATIC" ) endif () install (TARGETS ${name} DESTINATION bin) @@ -488,13 +488,13 @@ if (UNIX AND SUPPORT_CONSOLE_APP) set(TIDYHELP ${CMAKE_CURRENT_BINARY_DIR}/tidy-help.xml) set(TIDYCONFIG ${CMAKE_CURRENT_BINARY_DIR}/tidy-config.xml) add_custom_target(man ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}") - + ## Populate the @VARIABLES@ in the input file. configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/man/tidy1.xsl.in ${TIDY1XSL} ) - + # Run the built EXE to generate xml output . add_custom_command( TARGET man @@ -542,7 +542,7 @@ endif() #------------------------------------------------------------------------ # System Runtime Libraries -# Need to ensure that system DLLs get included in a binary +# Need to ensure that system DLLs get included in a binary # distribution, but since it can miss some - seems incomplete - make # optional. #------------------------------------------------------------------------ @@ -629,7 +629,7 @@ configure_file( "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc" @ONLY ) - + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" diff --git a/README.md b/README.md index bf48c5646..21072bf31 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ All other READMEs and related materials can be found in [README/][100]. Although ## Building HTML Tidy - For build instructions please see [README/BUILD.md][115]. - + ## Branches and Versions Learn about which branches are available, which branch you should use, and how HTML Tidy’s versioning scheme works. - Learn about version numbering in [README/VERSION.md][160]. - Learn about our repository branches in [README/BRANCHES.md][110]. - + ## Contributing and Development Guides We gladly accept PRs! Read about some of our contribution guidelines, and check out some of the additional explanatory documents that will aid your understanding of how to accomplish certain things in HTML Tidy. @@ -63,7 +63,7 @@ Tidy supports localization, and welcomes translations into various languages. Pl This repository should be considered canonical for HTML Tidy as of 2015-January-15. - This repository originally transferred from [w3c.github.com/tidy-html5][20], now redirected to the current site. - + - First moved to Github from [tidy.sourceforge.net][21]. Note, this site is kept only for historic reasons, and is not now well maintained. **Tidy is the granddaddy of HTML tools, with support for modern standards.** Have fun... @@ -93,4 +93,4 @@ HTML Tidy and LibTidy are free and open source software with a permissive licens [150]: README/MESSAGE.md [155]: README/OPTIONS.md [160]: README/VERSION.md - + diff --git a/README/ATTRIBUTES.md b/README/ATTRIBUTES.md index 0615998c3..6c5a530f1 100644 --- a/README/ATTRIBUTES.md +++ b/README/ATTRIBUTES.md @@ -14,9 +14,9 @@ So, to add a new `attribute=value`, on one or more existing tags, consists of th 1. `tidyenum.h` - Give the attribute an internal name, like `TidyAttr_XXXX`, and thus a value. Please try to keep this enumeration in alphabetical order. 2. `attrs.c` - Assign the string value of the attribute. Of course this must be unique. And then assign a `function` to verify the attribute value. There are already a considerable number of defined functions to verify specific attribute values, but maybe this new attribute requires a new function, so that should be written, and defined. - + 3. `attrdict.c` - If this attribute only relates to specific tags, then it should be added to their list. There are some general attributes that are allowed on every, or most tags, so this new attribute and value should be added accordingly. - + 4. `tags.c` - Now the new attribute will be verified for each tag it is associated with in the `tag_defs[]` table. Like for example the `