Skip to content

Trim trailing whitespace #911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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")
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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")
Expand Down Expand Up @@ -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.
#------------------------------------------------------------------------
Expand All @@ -276,19 +276,19 @@ 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 )

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" )
Expand All @@ -304,7 +304,7 @@ if ( ENABLE_CONFIG_FILES )
add_definitions( -DTIDY_USER_CONFIG_FILE="${TIDY_USER_CONFIG_FILE}" )

endif ()


#------------------------------------------------------------------------
# Shared Library
Expand Down Expand Up @@ -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 )
Expand All @@ -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
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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 ()


Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
#------------------------------------------------------------------------
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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...
Expand Down Expand Up @@ -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

4 changes: 2 additions & 2 deletions README/ATTRIBUTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<button ...>`, `{ TidyTag_BUTTON, ...` has `&TY_(W3CAttrsFor_BUTTON)[0]` assigned.

So, normally, just changing 3 files, `tidyenum.h`, `attrs.c`, and `attrdict.c`, will already adjust `tags.c` to accept a new `attribute=value` for any tag, or all tags. Simple...
Expand Down
16 changes: 8 additions & 8 deletions README/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## Prerequisites

1. git - [http://git-scm.com/book/en/v2/Getting-Started-Installing-Git][1]

2. cmake - [http://www.cmake.org/download/][2]

3. appropriate build tools for the platform

4. the [xsltproc][3] tool is required to build and install the `tidy.1` man page on Unix-like platforms.

CMake comes in two forms - command line and GUI. Some installations only install one or the other, but sometimes both. The build commands below are only for command line use.

Also the actual build tools vary for each platform. But that is one of the great features of CMake, it can generate various 'native' build files. Running `cmake --help` should list the generators available on that platform. For sure one of the common ones is "Unix Makefiles", which needs autotools make installed, but many other generators are supported.
Expand All @@ -23,11 +23,11 @@ In Windows CMake offers various versions for MSVC. Again below only the command

2. `cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]`

3. Windows: `cmake --build . --config Release`
3. Windows: `cmake --build . --config Release`
Unix/OS X: `make`

4. Install, if desired:
Windows: `cmake --build . --config Release --target INSTALL`
4. Install, if desired:
Windows: `cmake --build . --config Release --target INSTALL`
Unix/OS X: `[sudo] make install`

By default cmake sets the install path to `/usr/local/bin` in Unix. If you wanted the binary in say `/usr/bin` instead, then in 2. above use `-DCMAKE_INSTALL_PREFIX=/usr`.
Expand Down Expand Up @@ -70,5 +70,5 @@ make install
[2]: http://www.cmake.org/download/
[3]: http://xmlsoft.org/XSLT/xsltproc2.html


; eof
8 changes: 4 additions & 4 deletions README/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In either place please start with a short subject to describe the issue. If it i
- the output
- the _expected_ output
- some sample code (if an API question).

This information will make replication of your issue much simpler for us.

If you do add sample HTML input, then it can also be very helpful if that sample **passes** the W3C [validator](https://validator.w3.org/#validate_by_upload). Tidy attempts to follow all current W3C standards.
Expand Down Expand Up @@ -53,11 +53,11 @@ Concerning the “Tidy Code Style,” checkout [CODESTYLE.md](CODESTYLE.md), but

Item 2., SSH Key, is optional, and only required if you want to use `clone [email protected]...`. And if you generate the ssh without a `passphrase`, things like `git push` can be done without a password. Just convenience. Alternatively you can use the `HTTPS` protocol...

Concerning 5., editing and committing your changes, **generally** it is better to `commit` changes often, adding an appropriate commit message to each, like `$ git commit -m "Is. #NNN - reason for change" <file[s]>`. This also aids in the **PR** review.
Concerning 5., editing and committing your changes, **generally** it is better to `commit` changes often, adding an appropriate commit message to each, like `$ git commit -m "Is. #NNN - reason for change" <file[s]>`. This also aids in the **PR** review.

But the situation varies. Like adding say an option, which can mean several files have to be edited, where it is likely appropriate to combine a considerable number of edits into one commit. There can be no hard and fast rules on this.

Please note, if you want to change **multiple** things that don't depend on each other, use **different** `branches`, and make sure you check the `next` branch back out, before making more changes in a **new** branch name. That way we can take in each **change** separately, otherwise Github will **combine** all your branch commits into one **PR**.
Please note, if you want to change **multiple** things that don't depend on each other, use **different** `branches`, and make sure you check the `next` branch back out, before making more changes in a **new** branch name. That way we can take in each **change** separately, otherwise Github will **combine** all your branch commits into one **PR**.

See below on keeping your forks `next` fully in sync with here, called `upstream` - **this is important**.

Expand Down Expand Up @@ -85,7 +85,7 @@ $ ./testall.sh ../../tidy-fork/build/cmake/tidy
$ diff -u ../cases/testbase-expects ../cases/testbase-results
```

Use folder `tools-cmd` for windows. Run `alltest.bat --help`.
Use folder `tools-cmd` for windows. Run `alltest.bat --help`.

If the `tests` shows a different exit value, or there are differences between the `expects` and `results`, these **must** be studied, and checked, very carefully. There may be cases where the **new** `results` are correct, in which case a simultaneous **PR** for the forked `tests` **must** be created to match your forked source **PR**.

Expand Down
8 changes: 4 additions & 4 deletions README/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
## HTML parser and pretty printer

Copyright (c) 1998-2016 World Wide Web Consortium
(Massachusetts Institute of Technology, European Research
(Massachusetts Institute of Technology, European Research
Consortium for Informatics and Mathematics, Keio University).
All Rights Reserved.

Additional contributions (c) 2001-2016 University of Toronto, Terry Teague,
Additional contributions (c) 2001-2016 University of Toronto, Terry Teague,
@geoffmcl, HTACG, and others.

### Contributing Author(s):

Dave Raggett <[email protected]>

The contributing author(s) would like to thank all those who
helped with testing, bug fixes and suggestions for improvements.
helped with testing, bug fixes and suggestions for improvements.
This wouldn't have been possible without your help.

## COPYRIGHT NOTICE:
Expand All @@ -26,7 +26,7 @@ representations or warranties, express or implied, including
but not limited to, warranties of merchantability or fitness
for any particular purpose or that the use of the software or
documentation will not infringe any third party patents,
copyrights, trademarks or other rights.
copyrights, trademarks or other rights.

The copyright holders and contributing author(s) will not be held
liable for any direct, indirect, special or consequential damages
Expand Down
Loading