Compare commits

...

1230 Commits

Author SHA1 Message Date
Emelie Graven 99a7757363
Reenable automatic tagging
continuous-integration/drone/push Build is passing Details
2021-11-24 11:37:38 +01:00
Emelie Graven d4c88ea492
Manually tag docker images
continuous-integration/drone/push Build is passing Details
2021-11-24 11:23:46 +01:00
Emelie Graven c08df2334d
Fix dockerfile path
continuous-integration/drone/push Build is passing Details
2021-11-24 10:42:24 +01:00
Emelie Graven 3d90fec2a2
Add Dockerfile and drone config
continuous-integration/drone/push Build is failing Details
Adds a Dockerfile that builds the project, and a drone pipeline to push
the docker image to the docker hub.
2021-11-24 10:39:08 +01:00
Jim Derry 14223a95a8 Removed files not needed. 2021-08-27 08:23:05 -04:00
Jim Derry 9aadf20dd0 Bump version. 2021-08-26 17:33:51 -04:00
Jim Derry 949ad9dae3
Merge pull request #998 from htacg/issue_523
Fixes #523.
2021-08-26 17:33:14 -04:00
Jim Derry b5d28d7d30 Fixes #523.
Added test case to test flexibility.
Updated old test case 443678, which is better with this fix.

This fixes #523 and tries to be as general as possible. Right now the fix is
only applied if the prev or next tag is a body level div, but perhaps should
be applied for anything that's acting as block level element. In any case,
the specific bug is killed.
2021-08-26 15:59:33 -04:00
Jim Derry a873a190e1 Logging for ParseScript().
Improved debug output.
2021-08-26 09:10:28 -04:00
Jim Derry a604621fef Spacing fixes. No version bump. 2021-08-25 07:19:48 -04:00
Jim Derry 52e55d1554 Version bump due to binary changes. No new features. 2021-08-23 11:11:51 -04:00
Jim Derry 023cbd3f3d
Merge pull request #995 from htacg/debug_outp
Refactored debug output.
2021-08-23 11:11:09 -04:00
Jim Derry d956d6ca1c Refactored debug output. 2021-08-23 11:02:27 -04:00
Jim Derry 89665391f8 Bump version due to binary differences. 2021-08-19 18:20:37 -04:00
Jim Derry 29ec1df06c
Merge pull request #993 from htacg/pprinter_dox
Pprinter dox
2021-08-19 18:19:35 -04:00
Jim Derry 1d2a183f32 Set the indent character in a more appropriate spot.
The previous location was fine when saving the output stream, but it led to
unset character when using node interrogation, which _also_ uses the pretty
printers to get text. This is a more appropriate location to set the character.

This is the first instance of our cool Swift wrapper API tester catching an
issue for us. Nice!

Proof that the automated API
2021-08-19 18:12:29 -04:00
Jim Derry 0fe913eb76 Primarily documentation of the pprint.c/h, with some file organization and
function cleanup.
2021-08-19 16:14:46 -04:00
Jim Derry bde08388dc Delete stray control character from parser.c. No idea how that was introduced. 2021-08-18 06:30:37 -04:00
Jim Derry e32922175a Version bump to 5.9.14. 2021-08-17 15:03:24 -04:00
Jim Derry d057bcb44a
Merge pull request #990 from htacg/issue_611
Issue 611
2021-08-17 15:02:43 -04:00
Jim Derry 8a45f44f36 Tests cases for previous. 2021-08-17 14:53:28 -04:00
Jim Derry 0d72ca395f Fixes #611. 2021-08-17 14:51:40 -04:00
Jim Derry 86601b1153 Version bumped to 5.9.13 to reflect new behavior. 2021-08-17 12:37:24 -04:00
Jim Derry 1ca8e210c8 Fixes #525.
Naked groups of LI in HTML5 mode will now have an inferred UL applied to
them consistent with HTML4 and earlier modes.

Test case added.

Note that three regressions were updated in favor of this corrected behavior.
2021-08-17 12:34:43 -04:00
Jim Derry a46949f46a Bump to version 5.9.12. 2021-08-17 11:54:56 -04:00
Jim Derry 172d5a888c
Merge pull request #989 from htacg/issue_464
Fixes #464. Test cases added.
2021-08-17 11:52:07 -04:00
Jim Derry 6001011c80 Fixes #464. Test cases added. 2021-08-17 11:38:42 -04:00
Jim Derry 2e6ffff91e Bump to 5.9.11 for binary changes. 2021-08-17 07:33:39 -04:00
Jim Derry 845e55e5d4
Merge pull request #988 from htacg/xml_recurse
The XML Parser and XML Pretty Printer are now non-recursive.
2021-08-17 07:32:07 -04:00
Jim Derry 132fb352b1 The XML Parser and XML Pretty Printer are now non-recursive. 2021-08-17 07:24:53 -04:00
Jim Derry 71ff9a7a8a Documentation update. No version bump. 2021-08-15 11:17:50 -04:00
Jim Derry 2e259583a8 Bump version due to binary difference. 2021-08-15 07:31:56 -04:00
Jim Derry 28068b1273 Fixes #816.
Ensure thread safety by ensuring that tag_defs[] is thread local.
This has some overhead but is negligible on modern systems.
2021-08-15 07:29:40 -04:00
Jim Derry c8fbde5903
Merge pull request #986 from htacg/recurse_squash
Recurse squash
2021-08-14 20:52:23 -04:00
Jim Derry 2e7ec117fd Bump version. 2021-08-14 20:43:36 -04:00
Jim Derry 91f29ea7b8 HTML Tidy now parses HTML non-recursively.
Instead of recursive calls for each nested level of HTML, the next level is
pushed to a stack on the heap, and returned to the main loop. This prevents
stack overflow at _n_ depth (where _n_ is operating-system dependent). It's
probably still possible to use all of the heap memory, but Tidy's allocators
already fail gracefully in this circumstance.

Please report any regressions of your own HTML!

NOTE: the XML parser is not affected, and is probably still highly recursive.
2021-08-14 20:42:43 -04:00
Jim Derry b6f7e43842
Merge pull request #984 from htacg/issue_946
Fixes #946
2021-07-31 08:32:12 -04:00
Jim Derry efa61528aa Fixes #946 by refactoring the recursion into a loop with a heap-based stack. 2021-07-31 08:26:16 -04:00
Jim Derry c055b71c56 Deleted LICENSE again. Enough is enough. 2021-07-30 19:09:29 -04:00
Jim Derry c22c37b5a4 Add license to .github 2021-07-30 19:05:45 -04:00
Jim Derry e11dba9c92 Removed docs. 2021-07-30 19:03:40 -04:00
Jim Derry 995c20e9e4 Doc folder. 2021-07-30 18:57:02 -04:00
Jim Derry 1213047d42 More static analyser fixes; version bump to 5.9.7. 2021-07-30 18:45:18 -04:00
Jim Derry 5f98ccd606 Static analyzer fixes. 2021-07-30 18:32:34 -04:00
Jim Derry bd751a8bcd Fix allocation error; fix some static analyzer suggestions. 2021-07-30 18:23:47 -04:00
Jim Derry a3a5ea6740
Merge pull request #983 from htacg/remove_recursion
Remove recursion
2021-07-30 17:23:17 -04:00
Jim Derry b10a16ef1a Bump to 5.9.6 due to binary differences. 2021-07-30 17:16:43 -04:00
Jim Derry a34b0f07b5 Remove more recursion. 2021-07-30 17:15:58 -04:00
Jim Derry c21deae8c0
Bump to 5.9.5 due to API changes.
Will not build new pre-release as there are no public changing faces in the executables.
2021-07-30 16:50:09 -04:00
Jim Derry 7cddcb59fd
Merge pull request #982 from htacg/issue_719
Fixes #719. Pass the string representation of the parameter name, and…
2021-07-30 16:48:18 -04:00
Jim Derry 68a3d81d02 Fixes #719. Pass the string representation of the parameter name, and post process before output. Adds strrep() service to support. 2021-07-30 16:40:48 -04:00
Jim Derry 80550d6779 Updated localization information and files. No version bump. 2021-07-30 10:43:39 -04:00
Jim Derry b5e2442165
Bump version due to internal changes. 2021-07-29 06:23:28 -04:00
Jim Derry db847e6e1c
Merge pull request #981 from htacg/iterate
Documentation and Recursion
2021-07-29 06:22:48 -04:00
Jim Derry e56716f154 Improve internal documentation.
Start general conversion to eliminate and/or reduce recursion.
2021-07-28 19:46:54 -04:00
Jim Derry ab6b76dae9
Merge pull request #980 from SpaceIm/fix/cmake-pdb
CMake: robust installation of pdb files
2021-07-28 18:20:38 -04:00
Jim Derry 514ab0187c
Update build_and_test.yml
Add CMakeLists.txt as a trigger for automated testing, so that PR's making changes to it will be tested. No version bump.
2021-07-28 18:13:18 -04:00
SpaceIm 1da5d8ddde robust installation of pdb files 2021-07-27 14:56:48 +02:00
Jim Derry c42ec040c9
Update version.txt
User-facing URL changes merit version bump.
2021-07-21 17:30:24 -04:00
Jim Derry da8e10bedc
Merge pull request #978 from htacg/rc
HTTPS Migration
2021-07-21 17:29:39 -04:00
Jim Derry 0d173d61d7 HTTPS Migration
- Updated links with working https versions from http.
- Removed rotten links.
- Updated links that have since resolved to new addresses.
- Generated all new po's and pot from existing headers.
- Updated the regression tests to account for the new https:// URLS, and the
  changed reference to specification.
2021-07-21 17:21:27 -04:00
Jim Derry d79fe9f1eb
Merge pull request #976 from htacg/spelling_fixes
Spelling fixes, thanks to @jschleus.
2021-07-21 15:59:15 -04:00
Jim Derry 1bb72d6041 Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -04:00
Jim Derry 63c243f223
Update README.md 2021-07-21 15:12:33 -04:00
Jim Derry 168d09a0a8 Update proper ref to external repository. 2021-07-21 14:09:46 -04:00
Jim Derry 3bec3ea1f1 Updated automated build tools.
- The macOS package wasn't working, so remove it from the matrix build.

- Provide a macOS dedicated build script which builds a nice DMG and notarizes
  it.

- Binaries can be added to any existing tag, thus avoiding the issue of deleting
  and recreating a tag, which is a bad thing to do. Note that existing binaries
  won't be overridden, so delete whatever's already there first if you need to
  add new binaries.
2021-07-21 13:21:54 -04:00
Jim Derry a4f4edb106
Update publish_binaries.yml
Don't escape the slash, because it's not consistent across platforms.
2021-07-17 08:48:59 -04:00
Jim Derry c5f4c0d34b
Update publish_binaries.yml 2021-07-17 08:38:34 -04:00
Jim Derry 7f4394590e
Update publish_binaries.yml
Ensure the date format is the same as we use on the binaries page.
2021-07-17 08:34:08 -04:00
Jim Derry 408ac93195 Merge branch 'master' into next 2021-07-16 19:53:34 -04:00
Jim Derry 1ca37471b4 Merging gitignore; no version bump. 2021-07-16 19:45:24 -04:00
Jim Derry 81b7fe3251 Merging changes from Next. These do not affect the binary, so no version bump. 2021-07-16 19:42:23 -04:00
Jim Derry 7fd11fc9f2
Merge pull request #972 from balthisar/next
Build Files When Releasing
2021-07-16 17:11:10 -04:00
Jim Derry 9a6b1d09cc
Add files via upload 2021-07-16 16:52:20 -04:00
Jim Derry ed3ba3f48f - Improve package naming for macOS installer to eliminate semicolon from filename if multiple arches.
- Fix gitignore to ensure we don't add binary packages by mistake.
- Use better README files for macOS packages.
2021-07-16 16:39:45 -04:00
Jim Derry 7961be11ed Improve macOS and Linux package naming. 2021-07-16 15:44:53 -04:00
Jim Derry 47221924f6
Merge pull request #971 from htacg/update_test_repo
Don't pull test from personal repo.
2021-07-14 15:10:09 -04:00
Jim Derry 1e1064dfab Don't pull test from personal repo. 2021-07-14 14:38:12 -04:00
Jim Derry e03fee5e73
Merge pull request #970 from balthisar/next
Create api_test.yml
2021-07-14 11:31:06 -04:00
Jim Derry 8b4a06df76 Create api_test.yml
Perform LibTidy API testing upon PR's or pushes.
2021-07-14 11:19:47 -04:00
Jim Derry 1ef183a01e Add support for Clang modules.
Bump version for API tracking.
2021-07-13 19:43:40 -04:00
Jim Derry f90883b8cf Version bump for binary difference. 2021-07-13 15:55:17 -04:00
Jim Derry cdc632214c Fixes 968. Will immediately backport to master 2021-07-13 15:54:26 -04:00
Jim Derry bf093747fc
Update build_and_test.yml
Added support for automated testing of Windows Cygwin installations.
2021-07-12 13:47:02 -04:00
Jim Derry 228d8e90cd Merge Cygwin build change from next. 2021-07-12 10:03:53 -04:00
Jim Derry ad9a25b0f1 Fixes #967. I'm not going to bump versions, as this is a build fix without affecting binary outputs. 2021-07-12 09:53:05 -04:00
Jim Derry 67fbf636e4 Bumped next branch to next generation 5.9.x 2021-07-10 16:55:43 -04:00
Jim Derry dfad115417 Merge branch 'next' 2021-07-10 16:53:56 -04:00
Jim Derry 1d840aae38 Releasing HTML Tidy 5.8.0 2021-07-10 16:52:01 -04:00
Jim Derry 3838bf1c06 Updated RELEASE.md instructions. No version bump. 2021-07-10 16:42:58 -04:00
Jim Derry ee6cbb6f98 Documentation update. No version bump. 2021-07-10 15:14:27 -04:00
Jim Derry 561bc324f5
Merge pull request #961 from vitaly-zdanevich/patch-1
README.md: add Wikidata link
2021-07-10 13:52:58 -04:00
Jim Derry 0db7e9da59 Version bump due to binary differences. 2021-07-10 13:30:09 -04:00
Jim Derry 2f0047a95f
Merge pull request #966 from htacg/fix_soversion
Fixes #743.
2021-07-10 13:29:34 -04:00
Jim Derry b22e301226 Fixes #743. 2021-07-10 13:26:25 -04:00
Jim Derry 97e4177218 Version bump due to API changes. 2021-07-10 11:19:54 -04:00
Jim Derry 47159bda50
Merge pull request #965 from htacg/issue-743-rc
Fixed merge conflict; fixed non-build issue on macOS. RC for testing.
2021-07-10 11:19:24 -04:00
Jim Derry f95540b5c9 Fixed merge conflict; fixed non-build issue on macOS. RC for testing. 2021-07-10 11:13:58 -04:00
Jim Derry 79ff5ab896 Fixes #736. Language translators, please take a look at your translations. Version bump due to user-facing change. 2021-07-10 09:35:25 -04:00
Jim Derry 92414e8b68 Fixes #952 on non-WIN32 platforms. Modify WIN32 static library to tidy_static instead of tidys. 2021-07-09 20:40:17 -04:00
Jim Derry 089659cafc Fixes #846. Version bump due to user-facing change. 2021-07-09 16:10:24 -04:00
Jim Derry 009da61f8b Fixes #836. Version bump to reflect change. Test cases added. 2021-07-09 15:51:14 -04:00
Jim Derry 8d3019da22 Fixes #798. Version bump due to potential behavior change. 2021-07-09 15:39:37 -04:00
Jim Derry d54dcda389 Fixes #775. No version bump due to documentation only change. 2021-07-09 15:33:31 -04:00
Jim Derry 1dc6275512 Fixes #765. 2021-07-09 15:29:33 -04:00
Jim Derry 3dab4b31ce Fixed documentation for accessibility checking per #756; bump version due to public facing change. 2021-07-09 15:26:57 -04:00
Jim Derry 2614283faf Added documentation per #744. No version bump for documentation change. 2021-07-09 15:16:07 -04:00
Vitaly Zdanevich 0c2fd9b3ef
README.md: add Wikidata link 2021-07-03 02:47:47 +03:00
Jim Derry bed8efb620 Bump to 5.7.54 based on settings fix. 2021-07-01 16:14:53 -04:00
Jim Derry 098265d051
Merge pull request #959 from htacg/fix_snapshots
Fix issues with user-specified settings changing
2021-07-01 16:13:17 -04:00
Jim Derry ef3157e0ec Fix issues with user-specified settings changing
User-specified settings were being fiddled with by tidy internally. User
settings set by the user should always be able to be read back by the
user, but `AdjustConfig()` would change them. This change contributes
toward fixing the situation by using `AdjustConfig()` at the only point
that it's needed, as well by NOT automatically reverting to the snapshot
after outputting a buffer (which should be stateless, but caused PHP to
break because it tried to save buffer more than once, so subsequent calls
would use non-fiddle settings.).
2021-07-01 16:08:37 -04:00
Jim Derry 25fbb0f985 Bumped to 5.7.53 based on previous PR merge. 2021-06-30 14:10:36 -04:00
Jim Derry 4f6c723d3b
Merge pull request #953 from ihsinme/patch-1
simple fix for the range of the condition.
2021-06-30 14:09:59 -04:00
Jim Derry df8df89625 Bumped to 5.7.52 based on previous PR merge. 2021-06-30 13:42:14 -04:00
Jim Derry 2d15699ccf Merge branch 'add-muted' into next 2021-06-30 13:41:20 -04:00
Jim Derry 6d9e98d0a4
Merge pull request #949 from drichardson/add-muted
Add muted and playsinline video attributes for HTML5.
2021-06-30 13:40:57 -04:00
Jim Derry 83eb3c0136 Added testcase for #938 2021-06-30 13:39:19 -04:00
Jim Derry 521db71815 Merge branch 'add-muted' of https://github.com/drichardson/tidy-html5 into add-muted 2021-06-30 13:24:49 -04:00
Jim Derry 2641ff3cc3 Bumped to 5.7.51 due to previous merge. 2021-06-30 11:22:52 -04:00
Jim Derry 39c1e69be3
Merge pull request #930 from htacg/issue-839-2
Is. #839 -  new message for 'blank' title
2021-06-30 11:21:19 -04:00
Jim Derry ad8cae97bd Added test case for #839. 2021-06-30 11:17:41 -04:00
Jim Derry cf43bd3448 Update existing regression testing results to accommodate new behavior. This is
justified because we're simply reporting a new condition without changing output.
2021-06-30 11:08:13 -04:00
Jim Derry b9d1e2b5cc Merge branch 'next' into issue-839-2 2021-06-30 11:03:06 -04:00
Jim Derry dc2e2d2d66 Bumped to 5.7.50 due to recent PR merge. 2021-06-30 10:23:16 -04:00
Jim Derry 7f2a945337
Merge pull request #928 from htacg/issue-729
Is #729 - Show 'warnings' in all td cases
2021-06-30 10:21:59 -04:00
Jim Derry 4052718fb8 Added test cases for this PR. 2021-06-30 10:16:10 -04:00
Jim Derry bee0bf738a Merge branch 'next' into issue-729.
This brings in our regression testing again.
2021-06-30 10:04:16 -04:00
Jim Derry 4153b5784c Commonize versioning.
Eliminate the redundant test case version file from the recently re-merged
regression testing suite. Regression tests are now automatically versioned
the same as the current tidy source version.
2021-06-30 09:41:19 -04:00
Jim Derry 1622342783 Bumped version for recent merge. 2021-06-30 09:31:34 -04:00
Jim Derry e77d16ae75
Merge pull request #927 from htacg/issue-692
Issue #692 - too many titles
2021-06-30 09:29:58 -04:00
Jim Derry 65aa1bdd8c Added test cases to this PR. 2021-06-30 09:25:37 -04:00
Jim Derry 64784e2582 Merge branch 'next' into issue-692 2021-06-30 09:08:04 -04:00
Jim Derry afd60e5f1a
Merge pull request #957 from htacg/integrated_testing
Automated Testing
2021-06-30 08:55:35 -04:00
ihsinme 81603aa697
simple fix for the range of the condition.
simple fix for the range of the condition.
2021-06-13 15:25:27 +03:00
Jim Derry 5a1b65d089 Move the testing repository back into the Tidy codebase.
Automate testing of any PR's.
Updated README's explaining new processes.
2021-05-21 10:43:35 -04:00
Jim Derry fa6d5b545d Bump version due to new language availability. 2021-05-21 08:39:20 -04:00
Jim Derry 596ed9391e Merge branch 'language_de' into next 2021-05-21 08:38:11 -04:00
Jim Derry 5bc1ca5670
Merge pull request #942 from htacg/mac_info_plist
Link macOS console application with required plist
2021-05-21 08:27:04 -04:00
Jim Derry 3a55ac1ee1
Merge pull request #941 from htacg/backport_add_plist
Support modern macOS security features
2021-05-21 08:25:59 -04:00
Jim Derry c044ab323e
Update Info.plist.in 2021-05-21 08:23:10 -04:00
Doug Richardson dfd74c4803
Add muted and playsinline video attributes for HTML5. 2021-05-11 20:53:03 -07:00
Jim Derry 3230b08264 Added German language translation courtesy of michael.uplawski@uplawski.eu. 2021-04-28 16:20:14 -04:00
Jim Derry cfcf6b7667 Add support for the required Info.plist to the Tidy console application, thus enabling
notarization support that's now required on macOS.

Unlike the similar pull request on the master branch, this one ensures that the proper
version is always used, via the same mechanism that CMakeLists uses to set the version.
2021-04-28 14:47:50 -04:00
Jim Derry a6e5c9ec1b macOS requires embedding plist files in order to enable modern security features such
as enabling the hardened runtime and notarizing executables and disk images containing
them. This change provides a plist file to be embedded, and modifies the linker flags
for macOS targets in order to include the plist in the binary. This is done to the
Mach O executable in a backwards-compatible way, and has been tested as far back as
macOS 10.12 High Sierra.

Note: expect to carry this forward to 'next' branch; however this is being applied
to current official release master version 5.6.0 so that release disk images can be
notarized.
2021-04-28 10:20:51 -04:00
Geoff R. McLane f6376f82c8 gen-html.sh: fixes to run 'GPerl' scripts 2021-04-22 20:44:30 +02:00
Geoff McLane 2c75207c5e Is. #925, PR #932 - Bump to 5.7.47 for this merge 2021-04-15 18:23:43 +02:00
Russell Morris 7c2d950f13
Change open tag to Boolean (#932)
To address issue #925, PR #932
2021-04-15 18:21:00 +02:00
Geoff McLane a91ebf642b Is. #800 - ensure string is null terminated 2021-04-15 16:36:06 +02:00
Geoff McLane fc1943e57b Add gen-html.bat helper to gen release 2021-04-14 18:25:15 +02:00
Geoff McLane 2a9853759e Is. #681 PR #926 - Bump to 5.7.46 for this fix merged 2021-04-14 18:08:21 +02:00
Geoff McLane 957ee4a47e
Is. #681 - read-only files, and dirs (#926)
Tested in 3 majors OS'es... no problems... closes #681
2021-04-14 18:02:09 +02:00
Geoff McLane 8e70d4dfa2 Initial cut, to gen 'verhist.log' and 'x.x.x.html' 2021-03-26 21:10:48 +01:00
Geoff McLane 9f8d957e4d Is. #891 Bump to 5.7.45 for this fix. 2020-11-30 17:57:50 +01:00
Geoff McLane 0b18ab6978 Is. #891 Ensure no buffer over-run
Fixes #891
2020-11-30 17:56:09 +01:00
Geoff McLane cb03eedc91 Is. #908, PR #914 Bump to 5.7.44 for this merge 2020-11-30 16:27:47 +01:00
Caleb Callaway ba69b9e7cf
Support extended color names in HTML 5 validation (#914)
Fixes #908
2020-11-30 16:24:12 +01:00
Geoff McLane 4cf169360a Bump to 5.7.43 for these two commits 2020-11-24 20:29:10 +01:00
Geoff McLane d0869dd4bd Is. #487 - Remove duplicated warning output 2020-11-24 20:27:37 +01:00
Geoff McLane 69ade7d1c6 Fix attr def table to match enum
Error made when merging LOADING Is. #879, PR #902

And merging SLOT PR #848

Also added a BIG warning over attribute_defs table to try to avoid this
in future.
2020-11-24 20:25:38 +01:00
Geoff McLane df8ff5c2ab Is. #910 PR #912 Bump to 5.7.42 for this merge/fix 2020-11-22 19:49:35 +01:00
Caleb Callaway 20f1e3c7bc
Fix percentage validation in CheckLength (#912)
Fixes #910
2020-11-22 19:45:32 +01:00
Geoff McLane c0e6d6807e Is #903 PR #907 Bump to 5.7.41 for this merge 2020-11-22 18:05:35 +01:00
Caleb Callaway 91ae1274ac
Add SVG paint attributes (#907)
Fixes #903
2020-11-22 18:02:00 +01:00
Geoff McLane 3202273421 Is. #437 PR #645 Bump to 5.7.40 for this merge 2020-11-22 16:56:20 +01:00
Geoff McLane f49386e191
Issue #437 - re-use of 'wrap-php' option (#645)
closes #437
2020-11-22 16:44:31 +01:00
Geoff McLane a2065f8283 Is. #879 PR #902 Bump to 5.7.39 for this merge. 2020-11-21 18:11:45 +01:00
Geoff McLane e73bd626b3 Is. #879 PR #902 - Per #851 move 'LOADING' to end 2020-11-21 18:09:05 +01:00
Sid Vishnoi e5ef43f6c3
Is. #879: add loading attribute for img, iframe (#902)
Closes #879
2020-11-21 18:03:20 +01:00
Geoff McLane d6cd2538e9 PR #899 Bump to 5.7.38 for this mem leak fix 2020-11-21 17:12:12 +01:00
lutianxiong 8f0e7aa22a
Free attributes before return NULL (#899) 2020-11-21 17:10:12 +01:00
Geoff McLane 2d3ed43f4e Is. #896 PR #898 Bump to 5.7.37 for merge of fix and docs 2020-11-21 17:02:34 +01:00
Geoff McLane c6e0ccce1f
Is. #896 - make 'bear' docs match code (#898)
* Is. #896 - make 'bear' docs match code

* Is. #487 #462 add warn msg and do not get stuck until eof

The warning message could perhaps be better worded, and maybe there
should be another msg when a '>' is encountered while looking for a ']'
in a MS Word section, and perhaps the section should be discarded...

And perhaps it should be an error, to force the user to fix...

But the fix is good as it is, and these issues can be dealt with
later...

And this fix is piggy backed on this PR, but it is likewise related to
'word-2000' option...
2020-11-21 16:47:58 +01:00
Geoff McLane 7cda3aba38 Minor win build changes 2020-11-21 16:39:52 +01:00
Geoff McLane a2967d0699 Is. #848 Bump to ver 5.7.36 for this merge 2020-11-21 16:38:59 +01:00
Geoff McLane 8ca131cbec Is. #848 in line with #851 put new enum at end 2020-11-21 16:37:53 +01:00
lhchavez e51cd17c2d
Support the <slot> tag (#848)
* Support the <slot> tag

<slot> was added to the WHATWG HTML5 Living Standard on April 20, 2016.

* Also support the slot= attribute

Given that the <slot> tag by itself is not too useful, this commit also
introduces support for the global slot attribute.

* Using ParseBlock for <slot>

This is still suboptimal since ParseBlock will make it so that <slot>
always expects "Flow content", whereas the spec says that it should
have a Transparent content model.

In practice, it should allow all the cases that the spec allows for, but
it will also allow some cases that the spec does not allow. Notably, if
a <slot> tag is found in a Phrasing content (an inline context in
libtidy lingo), it will wrongly let Flow content (block tags in libtidy
lingo), whereas it shouldn't. But all in all, it's a good compromise.
2020-11-21 16:31:28 +01:00
Geoff McLane 48efad6a2b Is. #839 - 2nd look - add new message for 'blank' title
This is a compromise -

   1. Keep insertion of a blank title tag, if none.
   2. Add new warn if title tag is blank, in html5

	modified:   include/tidyenum.h
	modified:   src/language_en.h
	modified:   src/message.c
	modified:   src/parser.c
2020-10-11 17:56:08 +02:00
Geoff McLane 188988022d Fix typo, in purely DEBUG code, while exploring #863 2020-10-03 20:48:08 +02:00
Geoff McLane 4d833e9fde Merge branch 'next' of github.com:htacg/tidy-html5 into next 2020-10-02 18:34:19 +02:00
Geoff McLane 7cb5c8c6b5 Is. #895 PR #897 mod summary tag - Bump 5.7.35
Closes #895
2020-10-02 18:32:11 +02:00
Geoff McLane e0c1ce3a36 Is. #895 PR #896 mod summary tag - Bump 5.7.35 2020-10-02 18:30:32 +02:00
Geoff McLane 0145af2821
Merge pull request #897 from arrmo/issue-895
Correction for issue-895
2020-10-02 18:25:24 +02:00
Geoff McLane 1698f9b305 PR #886 cmake enhancement - bump 5.7.34 2020-10-02 18:18:29 +02:00
Geoff McLane 60ae043431
Merge pull request #886 from SvenPStarFinanz/next
COMPILE_FLAGS property only once per target, avoid overwriting.
2020-10-02 18:16:04 +02:00
Geoff McLane 2f1b3c53fd PR #884 Fix memleak in GetTokenFromStream - bump 5.7.33 2020-10-02 18:11:06 +02:00
Geoff McLane ddbcd2abd0
Merge pull request #884 from ltx2018/next
fix memleak in GetTokenFromStream
2020-10-02 18:07:33 +02:00
Geoff McLane a26e3033ec PR #881 trans language_pt_br.po - bump 5.7.32 2020-10-02 18:00:10 +02:00
Geoff McLane ebfc930190
Merge pull request #881 from hugotiburtino/complete_pt_br_translation
Complete pt_br translation
2020-10-02 17:57:48 +02:00
Geoff McLane e166e5afe5 PR #853 word-2000 PruneSection fix - bump 5.7.31 2020-10-02 17:51:45 +02:00
Geoff McLane 089d14a19f
Merge pull request #853 from esclim/next
Protect against NULL in PruneSection.
2020-10-02 17:48:06 +02:00
Geoff McLane f7e9de6c07 Is. #761 PR #830 - Bump to 5.7.30 for this fix. Closes #761 2020-10-02 17:23:23 +02:00
Geoff McLane 3dafcf1341
Merge pull request #830 from htacg/issue-761-1
Is. #761 - just deal with the 'uint' wrap
2020-10-02 17:16:45 +02:00
Russell Morris 34cb411dd5 Correction for issue-895
As proposed by @geoffmcl - thanks!
2020-09-30 19:57:08 -05:00
Geoff McLane ed28a4541f Is. #815, PR #832 - no-case 'html' - bump to 5.7.29 2020-09-28 20:31:04 +02:00
Geoff McLane 4b2d5db743
Merge pull request #832 from htacg/issue-815
Is #815 - Use case-insensitive test 'html'
2020-09-28 20:27:20 +02:00
Geoff McLane e10f647f2b Is. #876: add legacy qual. to 'quote-ampersand' opt. 2020-09-28 19:47:37 +02:00
Geoff McLane 442e46f634 Is. #892: correct typo closes #892 2020-09-28 19:39:18 +02:00
Geoff McLane 0473972c46 Update cmake/32 and win64/64 builds 2020-09-28 16:07:35 +02:00
Sven Paschukat 74a7b2ee9d COMPILE_FLAGS property only once per target, avoid overwriting. 2020-06-29 09:02:37 +02:00
lutianxiong 4377ab84a4
fix memleak in GetTokenFromStream
check asp & php if ParseAttribute return NULL
2020-06-20 09:19:17 +08:00
Hugo B Tiburtino 469dc09ac0 Add translation to TC_TXT_HELP_ENV_1A, B and C 2020-05-19 00:42:54 +02:00
Hugo B Tiburtino 1f29bbe803 Add translation to TC_TXT_HELP_3A and TC_TXT_HELP_CONFIG 2020-05-19 00:33:35 +02:00
Hugo B Tiburtino 3a4f1193f8 Add translation to TC_OPT_EXP_CFG and DEF 2020-05-19 00:19:55 +02:00
Hugo B Tiburtino 652a4add85 Add translation to TC_OPT_HELPENV and delete empty spaces at TC_OPT_HELPOPT 2020-05-19 00:16:21 +02:00
Hugo B Tiburtino f6913adb56 Add translation to some lines, e.g. MISSING_ENDTAG_OPTIONAL
Add translation to MISSING_ENDTAG_OPTIONAL, MISSING_QUOTEMARK_OPEN,
OPTION_REMOVED, OPTION_REMOVED_APPLIED, OPTION_REMOVED_UNAPPLIED,
STRING_ARGUMENT_BAD, and STRING_MUTING_TYPE.
2020-05-19 00:05:43 +02:00
Hugo B Tiburtino 1b4e863c23 Add translation to MALFORMED_COMMENT_DROPPING, EOS and WARN 2020-05-18 23:53:28 +02:00
Hugo B Tiburtino 6d99e27409 Add translation to "FOOTNOTE_TRIM_EMPTY_ELEMENT" 2020-05-18 23:44:07 +02:00
Hugo B Tiburtino b895ebc1d7 Correct: translate "warning" as "aviso", not "acesso" 2020-05-18 23:37:03 +02:00
Hugo B Tiburtino 85f0b658fd Add translation to "TidyMuteShow" 2020-05-18 23:05:15 +02:00
Hugo B Tiburtino de8eec327f Add translation to "TidyMuteReports"
And change "tabs" to "tabulações" at TidyKeepTabs.
2020-05-18 23:00:55 +02:00
Hugo B Tiburtino 4a74d6a027 Add translation to "TidyKeepTabs" 2020-05-18 22:45:33 +02:00
Eric 572538c6d7 Update clean.c
Protect against NULL in PruneSetion.
 A Null node happens when pruning unbalanced <![if ...]> <![endif]>.
2019-12-17 15:25:58 -05:00
Geoff McLane d1b906991a PR #825 #829 - Bump to 5.7.28 for doc fix 'LocalMap' to 'LocaleMap' 2019-07-08 20:52:14 +02:00
Geoff McLane cd21bb30ad
Merge pull request #829 from MrSorcus/patch-0
PR #825 #829 - Fix docs - "tidyLocalMapItem" to "tidyLocaleMapItem"
2019-07-08 20:48:57 +02:00
Geoff McLane 8ef80736a1 Is. #773 PR #823 - Bump to 5.7.27 for this fix 2019-06-07 20:54:13 +02:00
Geoff McLane e59a18decd
Merge pull request #823 from naveedpash/issue-773
PR #823 - added OS __ANDROID__ in tidyplatform.h - closes #773
2019-06-07 20:52:07 +02:00
Geoff McLane a067cc81d0 Is. #791 PR #809 - Bump to 5.7.26 for this fix 2019-06-07 20:35:52 +02:00
Geoff McLane dcf56a18ca
Merge pull request #809 from htacg/issue-791
Pr #809 - free some -xml-help allocations in tidy.c - closes #791
2019-06-07 20:31:47 +02:00
Geoff McLane d7b58cfba7 PR #793 - Bump to 5.7.25 for this small docs fix 2019-05-31 20:11:30 +02:00
Geoff McLane 654d00a7e8
Merge pull request #793 from SConaway/patch-1
Update BRANCHES.md
2019-05-31 20:08:46 +02:00
Sorcus 43901812fd Change "tidyLocalMapItem" to "tidyLocaleMapItem" 2019-05-25 13:06:54 +00:00
Geoff McLane 7bc23f0e80 Is. #761 - just deal with the 'uint' wrap 2019-05-20 21:01:13 +02:00
Naveed Aman Pasha 8fc8f745ec added OS __ANDROID__ to tidyplatform.h 2019-05-08 12:08:03 +05:00
Geoff McLane fd1fd8a388 Is #815 - Use case-insensitive test 'html' 2019-04-28 20:54:14 +02:00
Geoff McLane 0873d74f8e Is. #781, PR #782 - Bump to 5.7.24, for nl -h removal 2019-03-30 01:03:45 +01:00
Geoff McLane f7621d92fb
Merge pull request #782 from Lin-Buo-Ren/patch/fix-redundant-blank-lines-in-help
PR #782 - Drop redundant blank lines in -help - closes #781
2019-03-30 00:56:30 +01:00
Geoff McLane c80daabc4a PR #769 - Dump to 5.7.23, add 'data' tag - closes #649 2019-03-21 20:33:05 +01:00
Geoff McLane a71031f9e5
Merge pull request #769 from AntoniosHadji/issue-649
Issue #649 adding 'data' tag
2019-03-21 20:28:26 +01:00
Geoff McLane d51afe033e Switch 32-bit build to 'next' 2019-03-20 15:39:36 +01:00
Geoff McLane 68a29fb3e4 Is #797 - Bump to 5.7.21 for this fix - closes #797 2019-01-31 20:03:51 +01:00
Geoff McLane e46435fb29 Is #797 - use 'TidyRealloc' in place of raw 'realloc' 2019-01-31 20:01:02 +01:00
Geoff McLane 4b6849909d Is #752, PR #764 - Bump to 5.7.21 for this merge 2019-01-31 19:16:37 +01:00
Geoff McLane 273c25dd38
Merge pull request #764 from htacg/issue-752
Issue #752, and other items
2019-01-31 19:13:14 +01:00
Steven Conaway 492ac957e5
Update BRANCHES.md 2019-01-16 18:38:00 -08:00
Geoff McLane 0457fff59e Is. #746 PR #747 - Bump to 5.7.20 for this fix 2019-01-14 19:51:27 +01:00
Geoff McLane 68c70ae53a Is. #746 PR #747 - fix other dup 'const' modifier 2019-01-14 19:46:10 +01:00
Geoff McLane e91a1bb84e
Is. #746 - Merge PR #747 from drizt/extra-const
Fix extra const modifier
2019-01-14 19:36:19 +01:00
Geoff McLane c7d6b7c3e8 PR #762 - bump to 5.7.19 for BUILD.md fix 2019-01-12 14:59:55 +01:00
Geoff McLane be14e18e64
Merge pull request #762 from cmb69/php-build-docs
PR #762 - docs BUILD.md - PHP ≥ 7.1.0 recognizes tidy-html5
2019-01-12 14:55:52 +01:00
Geoff R. McLane 1d74ed8f27 Is. #791 - free some allocations 2019-01-09 20:55:33 +01:00
Geoff McLane 9b7205124b Is. #783 #770 #780 - Bump to 5.7.18 for this change 2019-01-08 14:54:13 +01:00
Geoff McLane 937d67c313 Is. #770 #780 maybe #790 - remove 'setlocal' from lib! 2019-01-08 14:52:13 +01:00
Geoff McLane f53ee9db90
Merge pull request #785 from Lin-Buo-Ren/patch/fix-i18n-locale-detection
Is. #783 PR #785 - Fix language detection
2019-01-08 14:41:54 +01:00
林博仁(Buo-ren Lin) 88b99acdd6 Is. #783 - Fix language detection
The `setlocale` call doesn't return a single locale name in glibc when
any of the locale category variable has a different value, instead it
returns a composite locale name which is a concatenation of the entire
list of locale name and its values, causing the language detection fail.

This patch attempts to set the language via LC_MESSAGES and LANG
environment variables which are commonly used in POSIX-like systems,
then fallbacks to `setlocale` as the last resort.
2018-12-03 22:21:14 +08:00
林博仁(Buo-ren, Lin) edc70c52be Is. #781 - Drop redundant blank lines in -help
Fixes #781.
2018-11-29 16:59:43 +08:00
Geoff McLane c6f194608f Is #726 PR #731 - Bump to 5.7.17 for this merge 2018-11-17 18:23:45 +01:00
Geoff McLane 75dd3a03f2
Merge pull request #731 from htacg/issue-726
Issue 726 upper case anchors
2018-11-17 18:20:07 +01:00
Antonios Hadjigeorgalis 5d4e46b333 Issue#649: added <data> tag
<time> tag used as model for adding <data> tag
2018-11-06 20:54:36 -05:00
Christoph M. Becker ff9550d74f PHP ≥ 7.1.0 recognizes tidy-html5
Cf. php/php-src@a552ac5bd5, which is
available as of PHP 7.1.0.
2018-10-15 15:25:39 +02:00
Geoff McLane b399903c84
Merge pull request #753 from Lin-Buo-Ren/patch-1
Is #752 - fix typo - tks
2018-09-06 00:50:13 +02:00
林博仁(Buo-ren Lin) 3e6a53f77e
Fix typo
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-05 23:26:52 +08:00
Geoff McLane 65c982f73e Is #752 - Replace _MSC_VER with _WIN32 2018-09-04 20:22:56 +02:00
Geoff McLane 840b3f9c1e Is #752 - Slightly enhance the API doxy docs 2018-09-04 20:21:48 +02:00
Geoff McLane 4ba6106057 Is #752 - Chg TC_MAIN_ERROR_LOAD_CONFIG to 'problems' 2018-09-04 20:20:14 +02:00
Geoff McLane 8c3ef4b6e2 Is #752 - Try STRING_MUTING_TYPE to TidyInfo 2018-09-04 20:17:55 +02:00
Geoff McLane ed8723c589 Is #741 - Elim. dup 2018-09-02 20:53:36 +02:00
Geoff McLane b697e48f16 Is #741 - add RELEASE.md document 2018-09-02 20:09:09 +02:00
Geoff McLane 94e62b24ff Is #752 - Add windows tilde expansion 2018-09-02 20:07:11 +02:00
Ivan Romanov 06e786fdf6 Fix extra const modifier
Fix #746
2018-08-20 12:09:58 +05:00
Geoff McLane 817ef6446c Is #729 - Show 'warnings' in all cases 2018-05-14 20:51:59 +02:00
Geoff McLane dc28b3487d Merge branch 'issue-726' of github.com:htacg/tidy-html5 into issue-726 2018-05-01 19:29:13 +02:00
Geoff McLane cb23ab0372 Is #726 #185 - HTML5 is case sensitive for anchors.
modified:   src/attrs.c
2018-05-01 19:28:49 +02:00
ler762 86b52dc108 Is #718 PR #727 - Update to CONTRIBUTING.md.2.txt
Modified README/CONTRIBUTING.md
2018-05-01 14:57:48 +02:00
Geoff McLane 5f7e367cb5 Is #718 #726 - Bump to 5.7.16 for this docs update 2018-04-27 15:33:51 +02:00
Geoff McLane b952e65300 Is #718 #726 - Some updates of CONTRIBUTING.md 2018-04-27 15:33:17 +02:00
Geoff McLane 68e6b3c20e Is #726 #185 - HTML5 is case sensitive for anchors.
modified:   src/attrs.c
2018-04-26 19:00:06 +02:00
Geoff McLane 23429b1b77 Is #719 - Bump to 5.7.15 for 'muted' callback fix 2018-04-26 14:22:55 +02:00
Geoff McLane a4600ac5b0 Is #719 - Set 'muted' before any callback 2018-04-26 14:20:14 +02:00
Geoff McLane 0606b0201a Is #721 PR #722 - Bump to 5.7.14 for this merge 2018-04-24 18:32:51 +02:00
Geoff McLane ddc68b4b71
Merge pull request #722 from htacg/issue-721
Is #721 - cast away some gcc warnings - PR #722
2018-04-24 18:30:35 +02:00
Geoff McLane afcea7c920 Is #713 - show-filename to errout when no warnings 2018-04-24 15:15:23 +02:00
Geoff McLane c8d3b4a8fb Is #713 PR #717 - Bump to 5.7.13 for this merge 2018-04-24 14:46:16 +02:00
Geoff McLane 9b076d0eca
Merge pull request #717 from ler762/doc-nits
Is #713 - Doc nits - PR #717
2018-04-24 14:41:24 +02:00
Geoff McLane ca4c991858 Is #709 PR #714 - bump to 5.7.12 for this merge 2018-04-23 19:15:38 +02:00
Geoff McLane a95c82df7f
Merge pull request #714 from htacg/issue-709
Is #709 - Improve message if 'implicit' - PR #714
2018-04-23 19:12:59 +02:00
Geoff McLane aa800c9482 PR #712 - Bump to 5.7.11 for this merge, and fix 2018-04-23 19:03:53 +02:00
Geoff McLane 8723681275 PR #712 - Only allow 'auto' on 'dir' for HTML5
modified:   src/attrs.c
2018-04-23 19:02:03 +02:00
Geoff McLane 3475d3e8cd
Merge pull request #712 from doronbehar/dir-auto
Make global attribute `dir` accept auto as well - PR #712
2018-04-23 18:51:17 +02:00
Geoff McLane 63071a9c40 Is 697 PR #708 - Bump to 5.7.10 for this merge 2018-04-22 14:40:38 +02:00
Geoff McLane 202ab98e10
Merge pull request #708 from htacg/issue-697-1
Is #697 - Add NOWRAP to print of pre tag - PR #708
2018-04-22 14:38:01 +02:00
Geoff McLane 45d8c1841b Is #673 Is #704 PR #705 - Bumped to 5.7.9 for this merge 2018-04-21 14:36:19 +02:00
Geoff McLane 63f507b4e9
Merge pull request #705 from htacg/issue-673
Is #673 - Revert 350f7b4 and 86e62db AdjustConfig logic - Is #704 PR #705
2018-04-21 14:28:59 +02:00
Geoff R. McLane 74fe3e0766 Is #721 - cast away some gcc warnings 2018-04-20 19:56:35 +02:00
Geoff McLane c2394db027 Is #700 PR #703 - Bump to 5.7.8 for this merge 2018-04-19 19:01:24 +02:00
Geoff McLane 6ca145a646
Merge pull request #703 from htacg/issue-700
Is #700 - change script parsing if in html5 mode - PR #703
2018-04-19 18:59:12 +02:00
Geoff McLane 121379fd56 Is #698 PR #702 - Bump to 5.7.7 for this merge 2018-04-19 14:51:56 +02:00
Geoff McLane 4ded90189f
Merge pull request #702 from htacg/issue-698
Issue #698 - docs update - PR #702
2018-04-19 14:49:52 +02:00
Geoff McLane 9e21f97daf Is #686 PR #701 - Bump to 5.7.6 for this merge 2018-04-19 13:54:47 +02:00
Geoff McLane 0263dfb6b2
Merge pull request #701 from htacg/issue-686
Is #686 - Add attr COLOR to W3CAttrsFor_LINK - PR #701
2018-04-19 13:52:10 +02:00
ler762 ac287d56bd fix spelling mistake 2018-04-13 11:29:55 -04:00
ler762 8d86ed24e9 add --show-filename option to show the input filename on output messages 2018-04-13 10:25:01 -04:00
Lee fa78a324d0 update --gnu-emacs option documentation 2018-04-13 10:01:39 -04:00
Geoff McLane 1a86dca705 Is #679 PR #695 - To 5.7.5 for this merge 2018-04-13 15:28:23 +02:00
Geoff McLane e10c29bde8
Merge pull request #695 from htacg/issue-679
Issue 679
2018-04-13 15:25:32 +02:00
Geoff McLane f460e8fd1e Is #684 - To 5.7.4 for this 'docs' change 2018-04-13 15:12:13 +02:00
積丹尼 Dan Jacobson a77dfb686f Update language_en.h
Default: no means YES DO print out comments.
If set to YES, then DON'T print out comments.
(cherry picked from commit 95af5ad39a)
2018-04-13 15:09:14 +02:00
Geoff McLane 73689a443b
Merge pull request #684 from jidanni/patch-1
Update language_en.h
2018-04-12 14:56:38 +02:00
Geoff McLane d85cc8c23d Is #709 - Improve message if 'implict' 2018-04-06 14:48:26 +02:00
Doron Behar 6636602260 Make global attribute `dir` accept auto as well. 2018-04-04 13:29:30 +03:00
Geoff McLane 02c8100e76 Merge branch 'issue-698' of github.com:htacg/tidy-html5 into issue-698
Conflicts:
	man/tidy1.xsl.in
2018-03-27 19:30:19 +02:00
Geoff McLane 8d5ff2c514 Is #692 - Add a 'CleanHead' service 2018-03-27 15:36:15 +02:00
Geoff McLane 3c386809a7 Is #700 - change script parsing if in html5 mode 2018-03-23 20:08:54 +01:00
Geoff R. McLane 51e0926c08 Is #698 - Mention need for ':' in config file 2018-03-21 19:34:11 +01:00
Geoff McLane e36df3b4cd Is #697 - Add NOWRAP to print of pre tag 2018-03-20 19:52:35 +01:00
Geoff McLane 6f37505704 Is #698 - Mention colon in 'man' text 2018-03-20 15:42:21 +01:00
Geoff McLane 3843cdc3aa Is #692 - correct message titles in head 2018-03-17 14:24:27 +01:00
Geoff McLane db02d4504b Is #686 - Add attr COLOR to W3CAttrsFor_LINK 2018-03-08 18:10:23 +01:00
積丹尼 Dan Jacobson 95af5ad39a
Update language_en.h
Default: no means YES DO print out comments.
If set to YES, then DON'T print out comments.
2018-03-03 14:49:03 +08:00
Geoff McLane bb7c494657 Is #679 - add 'priority-attributes' to -show-config 2018-02-19 17:22:12 +01:00
Geoff McLane ea4ae0dd13 Is #679 - some fixes for -export-config 2018-02-19 03:21:04 +01:00
Geoff McLane 67eaeb6d18 Is #673 - Revert 350f7b4 and 86e62db
While these look like a code cleanup, they appear to have an adverse
consequence in the use of libtidy by PHP 7+, so have been reverted.

	modified:   src/config.c
	modified:   src/config.h
	modified:   src/tidylib.c
2018-02-14 18:54:01 +01:00
Geoff McLane 0c182bbfa1 Is #663 PR #664 - Bump to 5.7.3 for this merge 2018-01-01 18:29:34 +01:00
Geoff McLane 1f22358a57
Merge pull request #664 from htacg/issue-663
Issue 663 - fixes for Haiku port - closes #663
2018-01-01 18:28:05 +01:00
Geoff McLane 8731f25aa9 Is #655 PR #662 - Bump to 5.7.2 for this merge 2018-01-01 18:25:17 +01:00
Geoff McLane 1db2208106
Merge pull request #662 from htacg/issue-655
Issue #655 - Fix unsafe use of output buffer as input param - closes #655
2018-01-01 18:22:57 +01:00
Geoff McLane 5408bb70fd Is #656 PR #661 - Bump to 5.7.1 for this merge 2018-01-01 18:19:34 +01:00
Geoff McLane a111d7a969
Merge pull request #661 from htacg/issue-656
Issue #656 - protect against NULL node set in loop - closes #656
2018-01-01 18:15:33 +01:00
Geoff McLane 28be79db50 Is #663 - Reduce static alloc to as required 2017-12-25 18:10:29 +01:00
Geoff McLane ccde058772 Is #663 - Open context for gcc 2.95 port 2017-12-25 03:26:53 +01:00
Geoff McLane a33520ad85 Is #663 - Add language limit for 'Haiku' gcc 2.95 2017-12-25 03:25:29 +01:00
Geoff McLane 723c28afb3 Is #663 - Add 'Haiku' port, '__HAIKU__' 2017-12-25 03:23:57 +01:00
Geoff McLane 7af9e1843b Is #663 - Remove UTF-8 BOM from 6 lang. headers 2017-12-23 18:28:32 +01:00
Geoff McLane 7f9e02b2fb Is #663 - Small change for MSVC10 2017-12-23 17:36:05 +01:00
Geoff McLane 629843401d Issue #655 - Fix unsafe use of output buffer as input param 2017-12-16 21:10:04 +01:00
Geoff McLane a0414d65a6 Issue #656 - protect against NULL node set in loop 2017-12-16 20:54:29 +01:00
Jim Derry f0438bd4b8 Bumped next to 5.7.0 per our version numbering scheme. 2017-11-25 15:27:13 -05:00
Geoff McLane 3a30f6a430 Issue #600 - Update README/verhist.log 2017-11-25 14:54:41 +01:00
Geoff McLane b869049a9f Issue #600 - Bump to 5.6.0 release 2017-11-25 14:50:00 +01:00
Jim Derry 87dbccdb1b Version bump. 2017-11-22 12:34:33 -05:00
Jim Derry 2cc140355d Changed iterator internal logic to use a one-based index instead of 0; an
index of 0 can be considered NULL.
2017-11-22 12:33:12 -05:00
Geoff McLane 19e8796a5b Issue #403 PR #641 - Bump to version 5.5.85 for hot fix 2017-11-22 15:01:44 +01:00
Geoff McLane d23e22589e Issue #403 PR #641 - Hot fix for column tabs count 2017-11-22 15:00:14 +01:00
Jim Derry 3b0c3779fc Regenerated strings to match new string updates. 2017-11-20 09:55:24 -05:00
Jim Derry 1f1d0a525a Fixed missing closing tag preventing man build. No version bump. 2017-11-20 09:53:27 -05:00
Jim Derry c2c7b1dab2 Bump version. 2017-11-20 09:32:08 -05:00
Jim Derry 6d6eb3797b Merge remote-tracking branch 'origin/keep-tabs' into complete_callbacks 2017-11-20 09:31:44 -05:00
Jim Derry 9e09f1a722 Version bump. 2017-11-20 09:29:51 -05:00
Jim Derry 9eadf3078e Merge remote-tracking branch 'origin/issue-643' into complete_callbacks 2017-11-20 09:29:16 -05:00
Jim Derry 302660e3cb Version bump. 2017-11-20 09:28:48 -05:00
Jim Derry 314690ad7f Option changed callback now implemented. 2017-11-20 09:27:59 -05:00
Jim Derry b91c728c81 Bump version to 5.5.81 for API additions. 2017-11-19 15:46:40 -05:00
Jim Derry fcd4e90ea7 Fix issue where console app and API can't set an FPI for a doctype without
providing a quoted string. This is especially painful in a terminal, which
requires escaping quotes. Since all FPI's must start with + or -, this fixes
the issue.
2017-11-19 12:54:08 -05:00
Jim Derry ae20af4181 Added a new tidyOptionIsList() API service. 2017-11-19 12:02:24 -05:00
Jim Derry b342232378 Fixed logical issue with new iterators. 2017-11-19 11:02:13 -05:00
Jim Derry 8ddc0105f9 Add missing iterators for recently added options mute and priority attributes. 2017-11-19 10:21:46 -05:00
Jim Derry 7105dbe0ee Cosmetic update for doxygen. 2017-11-17 22:00:29 -05:00
Jim Derry b2d3bab9d1 Doxygen fixes for previous. 2017-11-17 21:55:46 -05:00
Jim Derry ac27e0c16e Version bump, for doxygen purposes. 2017-11-17 21:52:26 -05:00
Jim Derry 7598d9d0a1 Added internal documentation to parser.h. 2017-11-17 21:51:35 -05:00
Jim Derry 79f0d5752f Updated documentation for tidyOptIsReadOnly(). As this is documentation only,
no version bump.
2017-11-17 21:47:26 -05:00
Jim Derry 2957cb135b Moved orphans from attrapi.c to tidy.c; eliminate attrapi.c. This only affects internal binary representation, but there's not API change, so no version bump. 2017-11-17 21:39:30 -05:00
Jim Derry f5dfd31a76 Bump version. 2017-11-17 21:30:40 -05:00
Jim Derry e7bacf2245 Allow all parsers to accept NULLSTR input for API consistency. 2017-11-17 21:30:19 -05:00
Jim Derry 18874e0b10 Version bump. 2017-11-17 20:38:45 -05:00
Jim Derry fec21eebba Merge branch 'next' into fix_doctype_option 2017-11-17 19:17:14 -05:00
Jim Derry 1dd85ad1c6 Restore alphabetical order to the options enums and structure. No version bump. 2017-11-17 19:16:58 -05:00
Geoff McLane cea9a465f3 Issue #643 - Fix HTMLVersion function back to what it was! 2017-11-17 14:47:24 +01:00
Jim Derry e6c891ea00 Doctype made no sense! It was a write-only property in some cases, and uses
itself and DoctypeMode to make up for Tidy's ability to store only a single
value for an option. It's a little bit special relative to every single other
option, in that it's declared as a string, but also has a picklist. This change
makes Doctype behave in the way every other Tidy option behaves, and treats
Doctype as a string, but also supports selection via the picklist.
2017-11-17 08:11:22 -05:00
Geoff McLane a820ff5897 Issue #643 - Add VERS_HTML5 to VERS_FROM40 2017-11-17 02:52:32 +01:00
Geoff McLane 6a3e3fae77 Issue #643 - Only break lookup if 'code' AND 'version' found. 2017-11-17 02:46:14 +01:00
Geoff McLane eefd2edda7 Issue #643 - Set debug trap - NOT important 2017-11-17 02:44:54 +01:00
Geoff McLane 54f14ff9fc Issue #643 - Some entity table corrections.
Default all the VERS_CHECK to VERS_HTML5
Change OverBar to 8254 in place of 175
Change UnderBar to 95 in place of 818
Change angst to 197 in place of 8491
Add bsolhsub 10184
Change epsi to 949 over 1013
Change epsiv to 1013 over 949
Change ohm to 937 over 8486, although appears the same
Change phiv to 981 over 966
Remove race as a two-value entity
Add suphsol 10185
Change varepsilon to 1013 over 949
Change varphi to 981 over 966
2017-11-15 15:52:36 +01:00
Jim Derry bb15427e73
Merge pull request #648 from aureliojargas/patch-1
Fix typo
2017-11-15 08:49:31 -05:00
Aurelio Jargas cca0e8700a
Fix typo 2017-11-13 08:21:35 -02:00
Geoff McLane 97f7d2a41a Merge branch 'issue-643' of github.com:htacg/tidy-html5 into issue-643 2017-11-09 19:43:39 +01:00
Geoff McLane a754957808 Issue #643 - Greatly expand entities list 2017-11-09 19:41:57 +01:00
Geoff McLane d6414a69ae PR #647 now merged, bumped to 5.5.77, closes #646 2017-11-09 19:35:25 +01:00
Geoff McLane c4c1ca17a2
Merge pull request #647 from htacg/issue-646
Issue #646 - Correct 'INCLUDE_INSTALL_DIR' per 'master'
2017-11-09 19:30:34 +01:00
Geoff McLane 08dfa3db84 Issue #646 - Correct 'INCLUDE_INSTALL_DIR' per 'master' 2017-11-09 15:00:08 +01:00
Geoff McLane e4fc470592 Issue #403 - correct spelling 2017-11-07 20:36:55 +01:00
Geoff McLane 7bbeae3eea Issue #403 - Fix and enhance descripion of keep-tabs option 2017-11-07 20:29:04 +01:00
Geoff McLane 33ed10e961 Issue #643 - Greatly expand entities list 2017-11-07 19:08:58 +01:00
Geoff McLane b58abe30d0 Issue #403 - Special DEBUG change to 'see' tabs 2017-11-05 18:04:52 +01:00
Geoff McLane 2aeb2eeb7a Issue #403 - New 'keep-tabs' option to address this. 2017-11-03 19:16:17 +01:00
Geoff McLane 4b5c86ee47 Small fix to compile with MSVC10, exposed in #636
MSVC10 2010 enforces K&R C that all variables must be declared before code
in any given context.

Unable to fix a gcc option that will expose this...

modified: src/config.c
2017-11-02 18:47:18 +01:00
Jim Derry acd3c6c47e
Version bump. Can we get to 100 before release? 2017-11-01 15:07:03 -04:00
Jim Derry 86bde4624e
Merge pull request #640 from htacg/locale_fix
Address #639.
2017-11-01 15:06:19 -04:00
Jim Derry 57f623eb7c Updated PR to make LIBRARY default to the environment language, rather than just console tidy. 2017-10-31 17:41:32 -04:00
Jim Derry cc023c26b7 Address #639. 2017-10-30 07:53:35 -04:00
Jim Derry 9c4b040771 Bumped version due to internal refactoring and documentation updates. 2017-10-29 15:05:53 -04:00
Jim Derry 5fb1138840 Fixed indentation. 2017-10-29 15:04:51 -04:00
Jim Derry f5bdedecaf Cleanup
- Added doxygen documentation to `tags.h`
- Consistency to `tags.c` header.
- Moved TY_(DeclareUserTag) to tags.c/.h for consistency with the other list
  parsing declaratory functions.
- Merged user tags parsing into the general list, eliminating a lot of redundant
  code.
2017-10-29 14:58:02 -04:00
Geoff McLane 7beb591cf7 Issue #636 PR #637 - Bump to version 5.5.74 2017-10-29 18:32:41 +01:00
Geoff McLane 319cded6ec
Merge pull request #637 from jokester/remove-direct-strdup-free
use default allocator in place of strdup/free
2017-10-29 18:30:52 +01:00
Jim Derry b243e0f30a Version bump. 2017-10-26 19:19:56 -04:00
Jim Derry 86e62dbb70 Remove unnecessary AdjustConfig logic. 2017-10-26 18:25:55 -04:00
Jim Derry 350f7b4af7 Replaced AdjustConfig() with TY_(AdjustConfig)() 2017-10-26 18:08:17 -04:00
Jim Derry cc08bae5a9 Documentation updates. 2017-10-26 15:46:26 -04:00
Jim Derry 6ffb71c2bc Bump version for documentation changes. 2017-10-26 14:26:53 -04:00
Jim Derry b663c3965f Regenerate PO and POT for language changes. 2017-10-26 14:26:23 -04:00
Jim Derry 056bd85d3d Touch up option descriptions, particularly the encoding options in order to better describe their interaction. 2017-10-26 14:25:02 -04:00
Jim Derry aec686b1a9 Add a true "default" to TidyCSSPrefix so that it will be shown in documentation. 2017-10-26 14:24:35 -04:00
Jim Derry a1a58ec1bd Merge branch 'next' into snapshot_fixes 2017-10-25 20:03:17 -04:00
Jim Derry 504d2b3466 Version bump. 2017-10-25 19:59:14 -04:00
Jim Derry fc3cba86a8 I guess no one tried to use this before... it's been broken since the initial commit. We've been comparing the config value from a different option the whole time. 2017-10-25 15:04:49 -04:00
Wang Guan ff68144724 use default allocator in place of strdup/free 2017-10-26 00:54:55 +09:00
Jim Derry 773f58dbcb Updated PO and POT for updated description of TidyQuiet. 2017-10-20 08:58:53 -04:00
Jim Derry c12e2b2149 Ensure that `TidyQuiet` silences everything that it currently quiets, plus
`TidyConfig` and `TidyInfo` messages. This causes a single regression by hiding
`TidyInfo`; will publish PR in testing repo.
2017-10-20 08:52:37 -04:00
Jim Derry 4b1c048ee5 Correct configCallback logic fix. 2017-10-20 07:46:00 -04:00
Jim Derry d302559080 Doxygen fix. No bump. 2017-10-19 20:46:21 -04:00
Jim Derry a03ddc03a0 Documentation generation bug fix. Version bump. 2017-10-19 20:33:17 -04:00
Jim Derry 7e53038fa8 Updated documentation for doxygen. No version bump. 2017-10-19 20:27:12 -04:00
Jim Derry 492c9fb74b Avoid short circuit evaluation to give new callback a chance to execute.
Version bump.
2017-10-19 20:11:26 -04:00
Jim Derry a354eff596 Bumped version due to fix. 2017-10-19 17:41:35 -04:00
Jim Derry 6d8d153143 Merge pull request #630 from jokester/close-stdin-after-parse
close stdin and free its FileSource in tidyDocParseStdin
2017-10-19 17:41:00 -04:00
Jim Derry 6dd7919d16 Bumped version due to new debug behavior. 2017-10-19 17:38:33 -04:00
Jim Derry 9c96551fe0 Merge branch 'issue-604' into next 2017-10-19 17:37:22 -04:00
Jim Derry b190e8724a Bumped version for new option. 2017-10-19 17:22:47 -04:00
Jim Derry 93957e4b17 Merge pull request #629 from htacg/squelch_reports
Squelch reports
2017-10-19 17:21:37 -04:00
Jim Derry 6309abacda Bump for public API change. 2017-10-19 17:17:33 -04:00
Jim Derry feb0811ba2 Use the new tidyPlatform() in console, and fix (!!) bug where no platform is defined. 2017-10-19 17:16:59 -04:00
Jim Derry 2340e63f8b Expose the platform name to the public API. 2017-10-19 17:11:29 -04:00
Jim Derry c17df6aca2 Add platform definitions for other Apple operating systems. 2017-10-19 17:07:38 -04:00
Geoff McLane 41675e75f7 Issue #604 - Remove 'sprtf' code if not ENABLE_DEBUG_LOG 2017-10-14 12:27:19 +02:00
Geoff McLane 3b154dc407 Issue #604 - Try to fix. Initial cut. WIP 2017-10-13 20:50:53 +02:00
Wang Guan dacb63da31 close stdin and free its FileSource in tidyDocParseStdin 2017-10-14 02:44:33 +09:00
Jim Derry 6f51eced5e Place the last three report messages into the reports range of the enum, taking
them out of the dialogue range, so that they can properly be silenced.
2017-10-10 19:30:57 -04:00
Jim Derry 1d91942960 Renamed the proposed `squelch` and `squelch-id` to `mute` and `mute-id`,
respectively. Updated matching cases in test branch accordingly.
2017-10-10 08:21:14 -04:00
Jim Derry bcf4748b9c Merge branch 'next' into squelch_reports 2017-10-10 08:14:33 -04:00
Geoff McLane 0f86647741 Issue #604 - Default ENABLE_DEBUG_LOG to 'OFF' 2017-10-09 01:27:07 +02:00
Geoff McLane 1b20d4b764 Default ENABLE_DEBUG_LOG to 'OFF' 2017-10-09 01:25:42 +02:00
Jim Derry 346ba063c9 Expose the new property to the public API. 2017-10-08 12:03:48 -04:00
Jim Derry 6f0ada7ffe Typo 2017-10-08 11:53:36 -04:00
Jim Derry ad03b28318 Remove @todo note. 2017-10-08 11:51:19 -04:00
Jim Derry e6f007d8ba Code spacing consistency. 2017-10-08 11:44:45 -04:00
Jim Derry f72c3d27e1 Show full prototype in forward declaration. 2017-10-08 11:40:53 -04:00
Jim Derry 2e58434e8d Actually, we should only show labels on reports, not dialogue. 2017-10-08 11:30:29 -04:00
Jim Derry 0548e67fa5 Oops, need to return. 2017-10-08 11:19:00 -04:00
Jim Derry b967065c36 Merge branch 'next' into squelch_reports 2017-10-08 11:08:12 -04:00
Jim Derry 16aa474f6a Updated CMakeLists to require -DENABLE_DEBUG_LOG on all platforms, until a
better "automatic" strategy is decided.
Although this doesn't change Tidy binary, I bumped the version because the
default build settings _could_ result in a binary difference.
2017-10-08 11:06:41 -04:00
Jim Derry 626375346d Adds message squelching (muting) to Tidy, avoiding the need to specify a new
option every time we might want to allow or disallow new output. Adds two new
options:
  - `squelch-id` (default **no**) will provide tags during Tidy's output that
    can be used to silence warnings. For example, `MISSING_ENDTAG_OPTIONAL`
    will be shown after warnings of that type. Then in the future, the user can
    use...
  - `squelch` (default NULL) takes a list of message identification tags.
    Messages of this tag type will then be muted from output.

This gives the user great control over hiding things that he or she doesn't care
about seeing. However, muted errors/warnings still count toward error summaries.

If we merge this, then TidyShowMetaChange and TidyWarnPropAttrs are candidates
for removal (using the deprecation mechanism Tidy now has, these will continue
to work, though).
2017-10-08 10:47:03 -04:00
Jim Derry 5e66816380 Spacing consistency. 2017-10-08 10:25:09 -04:00
Jim Derry ab8a4249df Added `squelch-id` (TidySquelchShow) so that message ID's will be displayed in
the report output table. This can be used to show message ID's that the user
can use to filter against in the upcoming `squelch` option.
2017-10-07 18:10:46 -04:00
Jim Derry ca2f089e89 Regen pot and po 2017-10-07 16:25:40 -04:00
Jim Derry b31dd6fcc2 Added some internal structures and code to support the removal of config
options in the future, with full user notification. Right now this code is
dead, because no options have been removed. No version bump.
2017-10-07 16:11:51 -04:00
Jim Derry 217d05fe49 Merge branch 'next' into deprecation_mechanism 2017-10-07 14:59:35 -04:00
Jim Derry 010892c020 Version bump. 2017-10-07 14:59:07 -04:00
Jim Derry 0977aa6077 Removed dependency on NDEBUG, and introduced ENABLE_DEBUG_LOG in CMakeLists.txt.
By default Windows will continue to show SPRTF output, and other platforms will
require the -DENABLE_DEBUG_LOG to be set in default (debug) configurations.

Debug and Release builds on macOS, Windows 10, and Ubuntu 16.04 confirmed
working as most people expect.
2017-10-07 14:56:01 -04:00
Jim Derry f26b198213 Hot-fix the NDEBUG, which affected default builds that users might not expect
if they follow the build instructions.
2017-10-07 14:07:12 -04:00
Jim Derry 6b14c559f9 Adding some documentation WIP 2017-10-07 12:14:51 -04:00
Jim Derry 2e4393e37b Works for -config files now, too. 2017-10-07 11:20:57 -04:00
Jim Derry 483d17e39b Experimentally working. 2017-10-07 11:04:18 -04:00
Jim Derry 2e2062ddec WIP with functioning concept. 2017-10-06 16:14:54 -04:00
Jim Derry 4e6d76eb01 Fixed broken option callback; version bump to reflect. 2017-10-06 09:41:54 -04:00
Jim Derry f1cd84f853 Bumped version. 2017-10-05 19:29:12 -04:00
Jim Derry a413b1264b Merge branch 'next' into options_categories 2017-10-05 15:15:36 -04:00
Jim Derry c71b8115cc Bump version. Although changes are only internal, it's a good reference point
in case something goes wrong.
2017-10-05 15:09:18 -04:00
Jim Derry ac4a79a5ac Regenerate languages. 2017-10-05 15:08:46 -04:00
Jim Derry fa30773938 Centralize control of message output to the messageOut() method in order to:
- Prevent the message filter from missing possible messages due to dispered
    control.
  - Single decision point for the types of messages to be output given current
    conditions and options settings.
2017-10-05 15:04:22 -04:00
Jim Derry bd3503eea5 Changed the XML classes to use the string representation of the key rather than
the translated string of they key, which fix manpage and quickref generation in
non-default locales.

As a result the translated strings are no longer used and have been deleted.
2017-10-05 09:31:25 -04:00
Jim Derry 9565a15f48 Merge branch 'next' into options_categories 2017-10-04 13:42:25 -04:00
Jim Derry 4c74b14991 Not sure how this got missed. 2017-10-04 13:40:19 -04:00
Jim Derry 4fa26f4f5d Affects documentation only: updates the manpage (and soon the quickref) by
breaking up the existing options into several more logical categories.
2017-10-04 12:24:07 -04:00
Jim Derry 7d35bb14ef Version bump 2017-10-04 11:15:45 -04:00
Jim Derry 430fc6118d Merge branch 'sprtf' into next 2017-10-04 11:11:39 -04:00
Jim Derry 084ed21735 Version bump. 2017-10-04 11:00:04 -04:00
Jim Derry dedcb7bb4d SPRTF is now compatible with macOS and Linux, and most likely all supported
platforms.
2017-10-03 22:31:55 -04:00
Jim Derry ee54057d76 Added debug to several files. WIP 2017-10-03 21:09:59 -04:00
Jim Derry a137c068e5 Added debug to several files. WIP 2017-10-03 20:56:50 -04:00
Jim Derry 4e3c1a1562 Move all of the sprtf includes into tidyplatform.h 2017-10-03 20:42:29 -04:00
Jim Derry 1cd0438849 Standard Library file header; termporary notes for me. 2017-10-03 18:08:10 -04:00
Jim Derry 8d7e5f7f5a Documentation formatting. 2017-10-03 15:30:21 -04:00
Jim Derry 5ff6aa8a8b Not sure how this got missed... 2017-10-03 14:46:29 -04:00
Jim Derry 4d2e75024e Removed unused iconvtc from source 2017-10-03 14:26:23 -04:00
Jim Derry e41229749c TIDY_WIN32_MLANG_SUPPORT has been dead code for ages. Not tested, not maintained. 2017-10-03 14:24:01 -04:00
Jim Derry 9706b9e5c4 Purged TIDY_STORE_ORIGINAL_TEXT. 2017-10-03 14:18:49 -04:00
Jim Derry 9679d88fae Format macros nicely. 2017-10-03 14:14:59 -04:00
Jim Derry ab67229238 AUTO_INPUT_ENCODING has been dead since first git commit. 2017-10-03 14:10:54 -04:00
Jim Derry ff030aab7a ELEMENT_HASH_LOOKUP is no longer conditional, and is a permanent part of Tidy. 2017-10-03 14:04:32 -04:00
Jim Derry 558082cbfc Cleanup structure. 2017-10-03 14:00:40 -04:00
Jim Derry 238b8f0a66 Wipe out dead code. We use git for a reason, so it's never really deleted. 2017-10-03 13:56:31 -04:00
Jim Derry 67f7b77e1f Added a flag to CMakeLists.txt simply to point out that one can build without
support for ISO2022 natively. Of course, we've been doing this by default for
years with no ill effect, and all modern operating systems seem to support this
natively. It's probably best to keep this in here, unlike the other deletions.
2017-10-03 13:04:37 -04:00
Jim Derry a1e4dcc066 Removed option for SUPPORT_ACCESSIBILITY_CHECKS, regen'd strings. 2017-10-03 12:45:34 -04:00
Jim Derry dfa2501928 Removed option for SUPPORT_ASIAN_ENCODINGS, and regen'd strings. 2017-10-03 12:37:23 -04:00
Jim Derry 2758939406 Removed SUPPORT_UTF16_ENCODINGS, and regen'd strings. 2017-10-03 12:26:38 -04:00
Jim Derry 7a4a544a5d Squelch Mac OS X warning during build. No version bump. 2017-10-03 08:57:11 -04:00
Jim Derry 8f47c024ac code documentation; no bump 2017-10-03 08:26:51 -04:00
Jim Derry 77632e2fb8 Merge branch 'unix_features' into next 2017-10-02 13:39:17 -04:00
Jim Derry 1e88cf2ebc Version bump for change. 2017-10-02 13:35:26 -04:00
Jim Derry 0e3cb7c78e Merge branch 'issue_598' into next 2017-10-02 13:34:59 -04:00
Jim Derry 3efc0f92a5 Version bump for changed. 2017-10-02 13:31:35 -04:00
Jim Derry a4ea6999e8 Merge branch 'issue_616' into next 2017-10-02 13:31:12 -04:00
Jim Derry e959c22087 Bump version. 2017-10-02 13:27:42 -04:00
Jim Derry 47a32891c8 Merge branch 'issue_521' into next 2017-10-02 13:27:16 -04:00
Jim Derry 4bcff9f64e Version bump. 2017-10-02 13:21:26 -04:00
Jim Derry 6619062aaa Merge branch 'issue_575' into next 2017-10-02 13:19:40 -04:00
Jim Derry 78b6154a85 Version bump for applied patches. 2017-10-02 13:15:17 -04:00
Jim Derry 024f034fa3 Merge branch 'issues_588_591' into next 2017-10-02 13:14:49 -04:00
Jim Derry 40ca09c189 Bumped version due to previous merge. 2017-10-02 13:10:45 -04:00
Jim Derry 1cb08e90ae Merge branch 'issue_542' into next 2017-10-02 13:10:07 -04:00
Jim Derry b1e7bba512 Update the man page to show the actual RC paths, and only if RC's are enabled. 2017-10-02 12:54:03 -04:00
Jim Derry 8d6ae76993 Heavily comment CMakeLists.txt as part of documentation effort. 2017-10-02 12:17:16 -04:00
Jim Derry 9ef66151af Ensure that runtime config files are available (non-default) for non-Unix. 2017-10-02 10:42:25 -04:00
Jim Derry 9c6a1e47ae Added -export-config and -export-default-config so that users can generate a
starting config style with every option, suitable for rc files.
2017-10-01 19:49:44 -04:00
Jim Derry 393fdfda3f Updated the man page and the help output. 2017-10-01 19:19:47 -04:00
Jim Derry 1ad3241d3c Updated documentation to reflect the rc files Tidy will use on Unix systems,
and added a new -help-env service that intelligently displays information about
$HTML_TIDY, rc files, and application order.
2017-10-01 18:58:17 -04:00
Jim Derry 3168aed365 Merge branch 'next' into unix_features 2017-10-01 10:42:30 -04:00
Jim Derry 2860160b54 Version bump due to new behavior on Unix. 2017-10-01 10:42:18 -04:00
Jim Derry 298deb0a04 Update CMakeLists and tidyplatform to include automatic support for using
runtime configuration files on Unix-like platforms. This addresses #584 in the
strictest sense, but some message work needs to happen as a result of this
change.

Additionally, the tidyplatform.h has been reformatted for legibility as part of
the continuing (slow) effort to improve our internal documentation.
2017-10-01 10:39:30 -04:00
Jim Derry a4e0409323 Address #584
Modify the build system to assume config files by default. Modify tidyplatform
to accomodate these changes. Reformat tidyplatform for friendliness to new
developers.
2017-10-01 10:37:49 -04:00
Jim Derry 3658275f60 Documentation-only changes to the public headers for consistency with other
headers (part of long term internal documentation project). No version bump
as no binary image change.
2017-09-30 09:35:00 -04:00
Jim Derry 2852ad4c63 Fix #588 and #591
- Apply @geoffmcl's patches and tested.
2017-09-29 15:42:03 -04:00
Jim Derry 397fd1ace0 Address #598
- Add the download attribute to the anchor tag.
2017-09-29 15:30:43 -04:00
Jim Derry d3129694c7 Address #616
- Fix the declaration and parser for the bdi tag.
2017-09-29 15:15:33 -04:00
Jim Derry 6a2d80ef9a Address #521
- Tidy will now emit a TidyInfo message when end tags are missing for li tags,
    unless omit-optional-tags is yes.
2017-09-29 14:49:02 -04:00
Jim Derry b0f584fa24 Address #575 by adding a new footnote in TY_(ErrorSummary) suggesting that if
this behavior is not wanted, then which option to use to prevent it.
2017-09-29 11:25:17 -04:00
Jim Derry f2b87ccd7b Address #542
- change message to indicated missing quote is only suspected.
- change severity to TidyWarning.
- Update POT with new string.
2017-09-29 10:42:21 -04:00
Jim Derry d6c974b672 Version bump for new behavior. 2017-09-29 10:23:45 -04:00
Jim Derry be803cef0e Merge branch 'next' into issue_476 2017-09-28 13:56:41 -04:00
Jim Derry 0a8154b97e Merge branch 'next' into issue_476 2017-09-28 13:25:45 -04:00
Geoff R. McLane 5c224e4a70 Revert 6 files to 0664 2017-09-28 18:43:52 +02:00
Geoff R. McLane 37f413e459 revert tidyenum.h to 0664, from 0775 2017-09-28 18:42:28 +02:00
Geoff R. McLane 18f52d5916 Change perm back to 0664, from 0755, for tidy.c 2017-09-28 16:43:47 +02:00
Jim Derry 021d32b3a1 Update version.txt to reflect documentation update 2017-09-25 21:17:21 -04:00
Jim Derry 94111a7fe7 Merge pull request #614 from htacg/issue_435
Addresses #435 by updating documentation.
2017-09-25 21:16:45 -04:00
Jim Derry df3bde38ec Introduced `auto` behavior to the `fix-bad-comments` option so that `yes` or
`no` could be applied automatically per the document type. This is the new
default.
2017-09-25 15:26:03 -04:00
Jim Derry c74e47adbb Fixed the single hyphen issue. Tests passing. Implementation Ready. 2017-09-25 10:50:04 -04:00
Jim Derry 483e0fec9e Address issue #476, which started out as a simple message update.
- Change default value of `--fix-bad-comments` to `no`.
  - Ensure that when _not_ fixing, nothing is actually fixed.
  - Ensure that when fixing, initial adjacent hyphens actually are fixed.
  - Issue tidyinfo for all fixes made.
  - Issue tidywarning when when not making fixes for non-HTML5 doctypes.
2017-09-24 18:15:40 -04:00
Jim Derry 965b92a09c Addresses #435 by updating documentation. 2017-09-24 13:42:16 -04:00
Jim Derry cd9d46b53d Version bump for new messages and config option. 2017-09-23 19:21:58 -04:00
Jim Derry d4e6f74226 Merge pull request #613 from htacg/issue_434
Issue 434
2017-09-23 19:21:20 -04:00
Jim Derry 20a1b7bb69 Updated documentation relating to new option. 2017-09-23 07:53:57 -04:00
Jim Derry 64a4302e6c Migrated the attribute list parser to a general parser for future re-used by
other potential list-based options.
2017-09-23 07:30:17 -04:00
Jim Derry 70681131d6 New config option now drives the list; memory deallocated. 2017-09-23 07:20:31 -04:00
Jim Derry 23c28e5b82 Initial commit of #434; WIP 2017-09-22 22:14:59 -04:00
Jim Derry 64fb5640cb MSVC snuck in some tab characters... 2017-09-22 19:27:47 -04:00
Jim Derry c579d5b62c Address #412
Add a TidyInfo message each time an unquoted attribute is found. However,
refer to #412 for discussion before merging this.
2017-09-22 19:01:31 -04:00
Jim Derry cf6f47ca1c Squelch some MSVC 2010 warnings, and reset indentation in tidy.c. No version bump. 2017-09-22 17:27:49 -04:00
Jim Derry c30f8537a7 Updated version due to language change. 2017-09-21 07:39:16 -04:00
Jim Derry f1251f74a1 Merge pull request #610 from rffontenelle/update-pt-br
Update Brazilian Portuguese translation
2017-09-21 07:38:40 -04:00
Rafael Fontenelle b5db02aeb9 Update Brazilian Portuguese translation 2017-09-21 00:43:48 -03:00
Jim Derry 9614019e8c Added Portuguese (Brazil) localization to Tidy.
Rebased the new language due to organization of strings in newest-next.
Bumped version for external changes.
2017-09-20 17:57:42 -04:00
Jim Derry 41f946dfc1 Merge branch 'rffontenelle-include-portuguese-brazil' into next 2017-09-20 17:49:51 -04:00
Jim Derry c88f9c318c Merge branch 'include-portuguese-brazil' of https://github.com/rffontenelle/tidy-html5 into rffontenelle-include-portuguese-brazil 2017-09-20 17:49:22 -04:00
Jim Derry 2a4dc1af52 Merge branch 'dialogue_cleanup' into next
Version bump for internal API change.

Conflicts:
	version.txt
2017-09-20 17:47:27 -04:00
Geoff McLane 53cd1c8113 Issue #597, PR #599 - Bump version for this merge 2017-09-20 19:13:39 +02:00
Geoff McLane 79aa8b7460 Merge pull request #599 from htacg/memory-test
Issue #597 - Memory tests/diagnostics
2017-09-20 19:11:34 +02:00
Geoff McLane c38e48baeb Issue #594, PR #595 - Bumped version for this xml merge 2017-09-20 17:04:54 +02:00
Geoff McLane cd9bb76caf Merge pull request #595 from ablackton/fix/XmlElementNameParsing
Issue #594 - Parse XML element names beginning with Valid NameChar
2017-09-20 17:02:14 +02:00
Jim Derry f26d70c394 Added Doxygen documentation to the header. Some of these could be expanded a
bit, but they look nice in Doxygen.
2017-09-19 15:07:52 -04:00
Rafael Fontenelle c1a4f018df Add Brazilian Portuguese translation 2017-09-19 15:38:49 -03:00
Jim Derry 55ceb55fad Updated PO's and languages with minor changes from English. 2017-09-19 14:03:45 -04:00
Jim Derry 51e2e0f3bd Following the example of the recent changes in the "reports" aspect of Tidy's
output, classify and organize all of the dialogue type of messages. This paves
the way towards formalizing (and expanding!) the footnotes system with much
greater explanatory text, as well as providing much better fine-grained control
over which types of output that Tidy will produce.

Moved STRING_DOCTYPE_GIVEN, STRING_CONTENT_LOOKS, and STRING_NO_SYSID to the
Report paradigm from the Dialogue paradigm, as these are items that are
traditionally TidyInfo and included in the Report table, rather than any type
of dialogue.

At this point, we are exactly passing all tests.
2017-09-19 13:52:27 -04:00
Geoff McLane 55d287bc9d Issue #597 - Free the 'node' not stacked, and add 'message' 2017-09-18 19:47:52 +02:00
Geoff McLane eb81a53165 Issue #597 - Free the 'message' structure, in messageobj.c 2017-09-18 19:46:46 +02:00
Geoff McLane d5ba3d8939 Issue #597 - Switch to 'stderr' in sprtf.c 2017-09-17 16:30:37 +02:00
Geoff McLane a14cffc598 Issue #597 - Avoid reporting root node in lexer.c 2017-09-17 16:29:47 +02:00
Geoff McLane 5d017fe532 Issue #597 - Minor enhancement of memory debug in alloc.c 2017-09-17 16:28:39 +02:00
Geoff McLane 3e27882109 Issue #597 - Add WIN CRT memory debug in tidy.c 2017-09-17 16:27:17 +02:00
Geoff McLane 98eb7b20ba Issue #597 - Add some memory diagnostics options in CMakeLists.txt 2017-09-17 16:25:05 +02:00
Andrew Blackton 5a50afe42c Parse XML element names beginning with Valid NameChar 2017-09-11 14:00:11 -05:00
Jim Derry a79458a0ef Bump version for internal API changes. 2017-09-08 19:41:25 -04:00
Jim Derry 4509695445 Updated documentation in file.
Simplified the update counting.
2017-09-06 21:25:19 -04:00
Jim Derry 6bce1b377f Updated the POs and POT to reflect the re-sorted strings.
Updated language_fr.h reflect the re-sorted strings.
2017-09-06 20:55:36 -04:00
Jim Derry 6b3dfda263 Updated the MESSAGES.md readme for the updated message system.
At this point:
  - MSVC on Windows 10 compiles without warnings or errors.
  - GCC on Ubuntu 16.04 compiles without warnings or errors.
  - Test cases in `testbase` are clean on all of:
    - macOS
    - Windows 10
    - Ubunutu
2017-09-06 20:50:31 -04:00
Jim Derry 279dd55280 Regenerated PO's and POT. 2017-09-04 17:46:07 -04:00
Jim Derry 80cb74fece Removed comments from and sorted error messages, as they are documented elsewhere in code now, here, too. 2017-09-04 17:43:06 -04:00
Jim Derry a743c86e3f Removed comments from and sorted error messages, as they are documented elsewhere in code now. 2017-09-04 17:41:19 -04:00
Jim Derry d8220c061f Updated the remaining items, including all of the accessibility module items.
Note that there are several regressions in the accessibility test suit that
are not related to output messages. These are a result of previous work, and
these results should be updated in the test suite when this item is merged.
2017-09-04 17:35:57 -04:00
Jim Derry 832b4772ad A bit of organizational cleanup. 2017-09-04 16:49:49 -04:00
Jim Derry bc4388e317 Migrated surrogate errors; removed break after return. 2017-09-04 16:38:07 -04:00
Jim Derry 5b6edb5813 EncodingWarning and MissingAttr migrated. 2017-09-04 16:12:01 -04:00
Jim Derry f49c419908 Implement formatter for encoding reports. 2017-09-04 15:50:45 -04:00
Jim Derry 8cb4198724 Entity errors migrated. 2017-09-04 15:28:08 -04:00
Jim Derry 18754c701d Transitioned formatCustomTagDetected to the general formatter. 2017-09-04 11:44:54 -04:00
Jim Derry e3893eb8b3 Also merged reportBadArgument into standard formatter as above. 2017-09-04 11:40:34 -04:00
Jim Derry be22ad3d03 Move file errors into the standard formatter. Local context is preserved with
braces to not pollute stack for other cases.
2017-09-04 11:35:49 -04:00
Jim Derry 283f8974c3 Migrated reports using formatFileError and formatStandard to flexible messaging system. Migrated old reportNotice() to report(). 2017-09-04 11:24:48 -04:00
Jim Derry 1d2c019162 Added a new string to disambiguate between config files and other file types. 2017-09-04 11:23:37 -04:00
Jim Derry 66e4d1f8e6 Migrated reports using formatter formatCustomTagDetected. 2017-09-02 18:04:51 -04:00
Jim Derry 0c8f684a4b Migrated messages using formatter formatBadArgument to new message system. All tests passing. 2017-09-02 18:00:46 -04:00
Jim Derry 46aa9605ee All reports that can use formatAttributeReport are now using it. Moved the
badAccess flag to the point of detection.
2017-09-02 17:29:56 -04:00
Jim Derry 00178113c8 A *complete* inventory of every message has been completed, and the dispatchTable
reflects such. Some fleshed in report formatters are included with cases for
several of Tidy's reports, but nothing is yet enabled. All reporting is status
quo, and this is just a bunch of dead code at this point.
2017-09-02 16:47:14 -04:00
Jim Derry 83263466f2 Cleanup ReportNotice() a bit by introducing an HTMLVersion() function. 2017-09-02 12:54:02 -04:00
Jim Derry 951ed381a3 Restore message logic. No bump. 2017-08-31 13:45:01 -04:00
Jim Derry 5df01d314e Bumped to 5.5.37 because of #456 merge. 2017-08-31 13:18:11 -04:00
Jim Derry e5a05ae5a8 Address merge conflicts. 2017-08-31 13:15:28 -04:00
Jim Derry 2c82cfa23b Inventoried current error strings, and removed/commented out several:
- BAD_COMMENT_CHARS
  - BAD_XML_COMMENT
  - DTYPE_NOT_UPPER_CASE
  - ENCODING_IO_CONFLICT
  - INCONSISTENT_NAMESPACE
  - INCONSISTENT_VERSION
  - INDICATE_CHANGES_IN_LANGUAGE
  - UNESCAPED_ELEMENT
  - XML_ATTRIBUTE_VALUE
Re-sorted new tidy options.
All tests passing.
Bump version to reflect strings that are externally accessible to API.
2017-08-31 12:57:58 -04:00
Jim Derry 38814f9e3b Sort message labels for simpler inventorying. 2017-08-31 10:57:54 -04:00
Jim Derry e1cbafd647 Handle message outlook properly in messageOut(). 2017-08-31 10:44:16 -04:00
Jim Derry 5cd2603a68 Version bumped to 5.5.35 to reflect internal-only API change. 2017-08-30 20:04:03 -04:00
Jim Derry e5eb09198d Begin migration towards "one output function to rule them all." Consolidated
the basic reporting functions that share the same signature. This also resulted
in eliminating a string, and adding a new string to disambiguate between
errors and warnings.
2017-08-30 20:01:44 -04:00
Jim Derry 1562c42c2e Merge branch 'next' into issue-456
Manually fixed merge commits.
2017-08-28 15:17:10 -04:00
Jim Derry 7badd93417 Geenrated en_gb language from the PR'd PO. Version bump for recent PR's. 2017-08-28 14:29:02 -04:00
Jim Derry 1f3cf24e82 Merge pull request #590 from mthorpe7/fix_upstream_crash
Fix NULL pointer issue with Word2000 empty attributes.
2017-08-28 14:25:35 -04:00
Jim Derry 2780f01e9a Merge pull request #589 from niczero/f_en-gb
Fixed some en_gb spellings
2017-08-28 14:24:49 -04:00
Jim Derry 6533181edf Merge pull request #583 from htacg/issue-582
Issue #582 - Remove extra new line in 'classic' mode
2017-08-28 14:24:26 -04:00
Michael Thorpe 52465c6142
Fix NULL pointer issue with Word2000 empty attributes.
This appears to be an issue with Word2000 handling of empty attributes.

A reproduction case can be seen here:

```
$ cat test.html
<html xmlns:o="urn:schemas-microsoft-com:office:office">
    <body>
        <table>
            <img class="" />
        </table>
    </body>
</html>

$ ./tidy --tidy-mark no --word-2000 yes test.html
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 3 column 1 - Warning: <img> isn't allowed in <table> elements
line 2 column 1 - Info: <table> previously mentioned
line 1 column 57 - Warning: inserting missing 'title' element
line 3 column 1 - Warning: <img> lacks "alt" attribute
line 3 column 1 - Warning: <img> lacks "src" attribute
line 2 column 1 - Warning: trimming empty <table>
line 1 column 1 - Warning: <html> proprietary attribute "xmlns:o"
[2]    52405 segmentation fault  ./tidy --tidy-mark no --word-2000 yes test.html
```

This was called from 6f2fb6e0e7/src/clean.c (L1710).

(It is technically undefined behaviour to call strncmp with `NULL` pointers however).
2017-08-28 15:30:28 +01:00
Jim Derry e8e83dbe9f Regenerated POs and POT for new strings. No version bump required. 2017-08-28 10:06:41 -04:00
Jim Derry f28e809a36 Bumped to version 5.5.33. 2017-08-28 10:03:38 -04:00
Jim Derry 561d43c7e5 Merge pull request #579 from htacg/issue-567-2
Issue 567 2 - style tag to head
2017-08-28 10:02:25 -04:00
Jim Derry d4a11b553e Merge pull request #577 from htacg/issue-572
Issue 572
2017-08-28 10:01:48 -04:00
Jim Derry a26c4e0a18 Version bump for API change. 2017-08-26 12:50:33 -04:00
Jim Derry f4c64966f0 Added TidyConfigCallback and deprecated TidyOptCallback for consistency with
the remainder of the callbacks. TidyConfigCallback is now given a reference
to the instance of the TidyDoc that caused the callback to occur.

+    TidyConfigCallback
2017-08-26 12:47:18 -04:00
Nic Sandfield 090e3fca73 Fixed some en_gb spellings 2017-08-24 11:28:17 +01:00
Geoff McLane f7658b2c89 Issue #582 - Remove extra new line in 'classic' mode 2017-08-04 14:23:14 +02:00
Geoff McLane fa18c51871 Add a 'next' branch check to Win64/build-me.bat
No code change, so no version bump for this...
2017-08-02 20:30:28 +02:00
Geoff McLane 09f1806834 Issue #572 - discard an all space text node.
An earlier patch now passes back an all space text node. Previously this
would have been skipped. So add code in ParseList to detect, and discard
such a node.

Change committed:
	modified:   src/parser.c
2017-07-08 19:45:42 +02:00
Geoff McLane f26a068809 Issue #572 - More conditions for #396 2017-07-02 21:10:20 +02:00
Geoff McLane 50859e8258 Issue #567 - add option, messages, and fix node iteration.
Add option TidyStyleTags, --fix-style-tags, Bool, to turn off
this action.

Add warning messages MOVED_STYLE_TO_HEAD, and FOUND_STYLE_IN_BODY.

Fully iterate ALL nodes in the body, in search of style tags...

Changes to be committed:
	modified:   include/tidyenum.h
	modified:   src/clean.c
	modified:   src/config.c
	modified:   src/language_en.h
	modified:   src/message.c
2017-06-28 20:41:46 +02:00
Geoff McLane d4ca02adfb Issue #567 - Branch 'issue-567-2' to move all 'style' to 'head' 2017-06-18 20:06:24 +02:00
Geoff McLane b32e14a8ea Issue #456 - add new option `show-meta-change` 2017-06-09 03:11:39 +02:00
Geoff McLane 97292646f6 Issue #456 - Add 'Info:' message when charset replaced 2017-06-05 17:16:53 +02:00
Geoff McLane a4770daa2b Issue #456 - Add 'Info:' message, when meta added.
It also fixes the addition of the constant 'http-equiv="Content-Type"
attribute.
2017-06-04 20:44:02 +02:00
Geoff McLane 13b34c9d8b Issue #456 - BAH! Fix a stupid logic reversal 2017-06-04 15:41:16 +02:00
Geoff McLane e28ec72301 Merge branch 'next' into issue-456
Continue WIP #456
2017-06-04 14:59:18 +02:00
Geoff McLane e48b06b8c0 Bump version to 5.5.31 - closes #550 2017-05-30 18:17:13 +02:00
Geoff McLane 2c096dfa68 Issue #550 - K&R/MSVC10 fix - tidy.c 2017-05-30 18:15:25 +02:00
Geoff McLane eb127a5c5b Issue #550 - K&R/MSVC10 fix - message.c 2017-05-30 18:14:58 +02:00
Geoff McLane 722a841ce2 Merge branch 'next' into issue-456
This was to pick up the fix for #395, PR #564, and bumps the version to
5.5.30...
2017-05-29 14:36:14 +02:00
Geoff McLane dbe8a6a767 Issue #395, #564 - Bump to 5.5.30 for this fix 2017-05-29 14:28:34 +02:00
Geoff McLane 4136d85a9c Issue #395, #564 - Oops, restore orig char if not closing 2017-05-29 14:26:55 +02:00
Geoff McLane 40e1d64963 Issue #456 - A desparate commit to get this WIP right, but... 2017-05-27 20:13:51 +02:00
Geoff McLane 8a932f96eb Issue #456 - Oops, incorrect merge conflict 2017-05-27 18:52:49 +02:00
Geoff McLane 049bc6c288 mERGE branch 'next' into issue-456 2017-05-27 18:35:01 +02:00
Geoff McLane 34d37002c9 Bump to 5.5.29 - closes #395 2017-05-27 18:26:14 +02:00
Geoff McLane e23f29b145 Merge pull request #564 from htacg/issue-395
Issue 395 - self closing tags
2017-05-27 18:25:29 +02:00
Geoff McLane c61b5b7b0c Merge branch 'next' into issue-395 2017-05-27 18:20:28 +02:00
Geoff McLane 59a06293ab Bumped 5.5.28 for this merge - closes #392 2017-05-27 16:36:08 +02:00
Geoff McLane 4224227cb2 Merge pull request #563 from htacg/issue-392
Issue 392 - creeping php
2017-05-27 16:33:15 +02:00
Geoff McLane 825ad59262 Merge branch 'next' into issue-392 2017-05-27 16:25:24 +02:00
Jim Derry 5d057abdcb Bumped to 5.5.27 for console tweaks. 2017-05-21 14:33:10 -04:00
Jim Derry cefe56dda5 Merge branch 'improve_console_output' into next 2017-05-21 14:32:38 -04:00
Jim Derry 47c27ecf8e Generated French header file; bumped to 5.5.26 for updated French language. 2017-05-21 14:29:13 -04:00
Jim Derry 7080ed970a Merge pull request #559 from sballeste/next
Improve french translations (next branch).
2017-05-21 14:25:43 -04:00
Jim Derry b475ca593d Bumped to 5.5.25. 2017-05-21 14:24:57 -04:00
Jim Derry 996ddb813d Merge pull request #554 from htacg/issue-365
Issue 365
2017-05-21 14:24:03 -04:00
Geoff McLane c9c1d7ae55 Issue #395 - a potential fix 2017-05-21 01:47:36 +02:00
Geoff McLane 6f05041b5e Issue #392 - a simple fix, but maybe incomplete 2017-05-21 00:18:43 +02:00
Geoff McLane ec03beb361 Issue #552 - remove no 'case default:' warning in most gcc versions
Seems too small for a version bump. Closes #552
2017-05-19 18:38:01 +02:00
Sébastien Ballesté-Antich e07b54a4da Improve french language with poconvert. 2017-05-16 22:38:39 +02:00
Sébastien Ballesté-Antich cc4ad195c5 Add 3 msgid introduced in commit 5791c55 2017-05-16 21:43:58 +02:00
Sébastien Ballesté-Antich 7feab96480 Improve french translations. 2017-05-16 19:03:12 +02:00
Geoff McLane 21f008501a Issue #456 - Oops, also out of 'lexer.h' 2017-05-15 16:51:34 +02:00
Geoff McLane a7a4cd6a16 Issue #456 - avoid head work if showing body only 2017-05-15 16:42:49 +02:00
Geoff McLane f310f1d5de Issue #456 - Move new TidyMetaCharset to clean 2017-05-15 16:39:53 +02:00
Geoff McLane 6ebd12be67 Issue #456 - More work on this option 2017-05-14 19:08:29 +02:00
Jim Derry 9b2cd06711 Merge branch 'next' into issue-365 2017-05-13 22:27:14 -04:00
Jim Derry 8a639bf91b Bumped to 5.5.24 for language updates. 2017-05-13 22:25:12 -04:00
Jim Derry 66d0825e58 Merge pull request #557 from htacg/update_langs
Update languages against current English.
2017-05-13 22:24:43 -04:00
Jim Derry 5fad2252d2 Bumped to 5.5.23 for #378. 2017-05-13 22:20:36 -04:00
Jim Derry eb6bd1c1d5 Merge pull request #556 from htacg/issue-378
Address #378
2017-05-13 22:19:52 -04:00
Jim Derry 5791c55081 Update languages against current English. 2017-05-13 21:07:02 -04:00
Jim Derry 0f1e625324 Address #378
Addresses issue #378 by NOT emitting warnings if `fix-uri` is `no`, for HTML5
documents. This preserves existing behavior for legacy document types.
2017-05-13 20:46:48 -04:00
Jim Derry d18b21b94c Merge branch 'next' into issue-365 2017-05-13 19:55:19 -04:00
Jim Derry 86338b2634 Bumped to 5.5.22 for internal change. 2017-05-13 19:51:28 -04:00
Jim Derry b6bf48c24a Merge pull request #553 from htacg/new_picklists
New picklists and parsers
2017-05-13 19:50:20 -04:00
Jim Derry a399725a1e Fixed ParseAutoBool error. 2017-05-13 11:39:13 -04:00
Geoff McLane 8843199370 Issue #456 - Merge branch 'meta-charset' of tidy-html5-marco.
This pulls the work done by @marcoscaceres WIP #458 into the issue-456
branch, to complete the new add-meta-charset option.
2017-05-13 16:02:26 +02:00
Jim Derry 08399b5203 Cleanup -help-config output to better show new enumerator types from new parsers and picklists. 2017-05-12 10:52:59 -04:00
Jim Derry 982504eee0 Case insensitive compare is safe here, and prevents erroneous propriertary attribute errors. 2017-05-12 08:28:11 -04:00
Jim Derry e7c28636b9 Fixed cause of assertions -- funny, these don't pop up in XCode. 2017-05-12 07:30:20 -04:00
Jim Derry 29766afcfd Initial take on issue 365. This is based off of the simplification of the
parser and picklist system. Console application needs to be updated to fix
the description, as it shows autobool, and for some reason on the current
system I'm not getting assertion failures.
2017-05-11 18:12:56 -04:00
Jim Derry 66bed8b9a0 Bumped to 5.5.21 for #391 fix. 2017-05-11 15:25:46 -04:00
Jim Derry 7112fba553 Merge pull request #549 from htacg/issue_391
Address #391. Tested on macOS and Win10.
2017-05-11 15:24:44 -04:00
Jim Derry 1ba4bcb753 Update the OPTIONS.md readme file. 2017-05-11 14:54:53 -04:00
Jim Derry aeb9a24fab Refactor Picklists and Option Parsers
This PR refactors how picklists and option parsers are implemented in LibTidy,
making is vastly easier to implement new picklists in the future, as well as
modify some of the existing picklists such that they have more logical names.

Picklist arrays are now arrays of structures that include the possible strings
capable of setting a particular option value, and a new parser has been written
to work with these structures.

In addition, several of the existing parsers were removed, as they are now
redundant, and a couple of the remaining parsers were refactored to take
advantage of the new parser.

In effect, this means that:

- New parsers don't have to be written in the majority of cases where new
  options are added that exceed yes/no/auto.
- Some of the existing options can have more meaningful names than yes/no/auto,
  in a backward compatible way. For example, vertical-spacing "auto" currently
  in no way reflects "auto" when used.
2017-05-11 14:40:21 -04:00
Geoff McLane f7e7554c95 Close the file before the _WIN32 switch 2017-05-09 19:24:20 +02:00
Jim Derry 590a030756 Bumped to 5.5.20 for latest fix. 2017-05-08 17:37:55 -04:00
Jim Derry acaab679c5 Merge pull request #547 from htacg/issue_352
Attempt to address issue #352.
2017-05-08 17:36:52 -04:00
Geoff McLane 77420b94d0 Fix for 'isalnum' in Windows
According to the MSN documentation 'isalnum(c)' is only valid when c equals
EOF, or is in the range 0 to 255 inclusive. It states the behavior is
undefined outside this range, and in Debug mode triggers an assert dialog.
2017-05-08 18:42:33 +02:00
Jim Derry ce105dcf09 Address #391. Tested on macOS and Win10.
- Add a check upon opening a file for validity of the file.
- Add a new message to indicate that the path is not a file.
2017-05-07 17:04:53 -04:00
Jim Derry 6f2fb6e0e7 Bumped version to 5.5.19 for merge. 2017-05-07 15:03:04 -04:00
Jim Derry 8244052cd1 Merge branch 'deprecations' into next 2017-05-07 15:01:49 -04:00
Jim Derry fe451eaa7d Address #452. 2017-05-06 19:18:01 -04:00
Jim Derry fd77312175 Attempt to address issue #352. This patch correctly address the specific issues
in #352, but I'm worried that there's some over-reach here.

Currently only implemented as a warning, with no switch to turn it off, which
maintains current behavior other than the warning.

In general, we're treating any string as a complete URL, rather than breaking
URL's into component parts. Thus the `IsURLCodePoint()` check includes a few
other generic characters that strictly speaking aren't valid codepoints, but
are valid as escape characters and delimiters.

When addressing #338, I ran into a similar situation in not having a built-in
method to separate path components (although a simple generalized solution was
good enough in that case).

Thus without introducing a new structure and functions to deconstruct a URL
into scheme, authority, path, parameters, etc., some variation of this patch
will have to be used to address #352.
2017-05-06 18:54:42 -04:00
Jim Derry 09d1802298 Merge branch 'next' into deprecations 2017-05-06 14:34:48 -04:00
Geoff McLane fd2400d55b Merge pull request #543 from htacg/issue-436
Small documentation change to close #436
2017-05-06 15:44:45 +02:00
Geoff McLane 61d19c9a86 Merge #537 - Bump 5.5.18 for this gdoc fix 2017-05-06 15:37:56 +02:00
Geoff McLane d4978608e7 Merge pull request #537 from deathbaba/next
Correctly process 'bookmarks' in html exported from Google Doc.
2017-05-06 15:35:57 +02:00
Geoff McLane 1257a49823 Merge #541 - Bump to 5.5.17 - Closes #338 2017-05-06 15:26:09 +02:00
Geoff McLane 6839dfe601 Merge pull request #541 from htacg/issue_338
Issue #338 - fix 3 spurious access level 3 warnings...
2017-05-06 15:20:55 +02:00
Geoff McLane 594275712c Merge #532 - Bump to version 5.5.16 for new 'warn-proprietary-attributes' 2017-05-06 14:51:19 +02:00
Geoff McLane 6da0fff256 Merge pull request #532 from lhchavez/add-warn-prop-attrs
Add a flag to warn on proprietary attributes
2017-05-06 14:48:36 +02:00
Geoff McLane f9edab1c33 Merge #540 - Bump to 5.5.15 - closes #461 2017-05-06 14:21:13 +02:00
Geoff McLane 6e8fcaa0e5 Merge pull request #540 from htacg/issue-461
Issue #461 - alternative patch for this issue
2017-05-06 14:19:17 +02:00
Jim Derry 846b3cde55 Address #436 just to close it. 2017-05-04 13:45:06 -04:00
Geoff McLane d142527a8e Issue #338 - Deal with two other spurious access warnings 2017-05-04 17:36:39 +02:00
Jim Derry bbaad8356d Fix macOS issue with make package. 2017-05-04 09:53:42 -04:00
Jim Derry 7f8394e050 Merge pull request #534 from spk/cmake-pkg-config
Generate pkgconfig file for tidy
2017-05-04 09:53:14 -04:00
Jim Derry 14f5980117 macOS fixes. 2017-05-04 09:50:36 -04:00
Jim Derry 49b833f63b WIP 2017-05-03 18:16:03 -04:00
Jim Derry 8b2f92f625 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.
2017-05-03 16:15:44 -04:00
Laurent Arnoud 3333ca7d69
Fix pkgconfig install path on package 2017-05-02 20:28:48 +02:00
Geoff McLane b03598652f Issue #461 - alternative patch for this issue 2017-05-02 19:39:16 +02:00
Alexander Zolotarev 87169d8953 Correctly process 'bookmarks' in html exported from Google Doc. 2017-04-19 14:47:27 -10:00
Laurent Arnoud 4066171ea2
Generate pkgconfig file for tidy 2017-04-18 00:43:43 +02:00
lhchavez a19d271f47 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.
2017-04-15 03:17:16 +00:00
Geoff McLane d8839485a4 Merge branch 'next' of github.com:htacg/tidy-html5 into next 2017-04-09 02:09:19 +02:00
Geoff McLane 72612b6ca3 Issue #524 - Bump to 5.5.14 for this message change 2017-04-09 02:08:58 +02:00
Geoff McLane 219a5c797b Issue #524 - Remove obsolete message 2017-04-09 02:08:03 +02:00
Jim Derry d1e0b22be7 Removed TidyDropFontTags. Note that POs and POT were _not_ updated. 2017-04-04 14:42:47 -04:00
Jim Derry 24afc6a6fa Fixed some casting issues that Ubuntu object to.
- Test on macOS, Win10, Ubuntu.
- No version bump for this change.
2017-04-04 14:33:56 -04:00
Jim Derry ce1e638a0f Added documentation to tidy.c for potential developers to look at and
understand.

- No version bump as no API was changed; just comments and reorganization.
- Built and tested in macOS, Win10, and Ubuntu.
2017-04-04 14:07:20 -04:00
Jim Derry 19c0655333 Bump to 5.5.13 for PR. 2017-03-31 13:36:15 -04:00
Jim Derry 2ad675556d Merge pull request #517 from htacg/issue-333
Issue 333
2017-03-31 13:35:41 -04:00
Geoff McLane dfad372af0 Merge branch 'issue-333' of github.com:htacg/tidy-html5 into issue-333 2017-03-26 16:57:47 +02:00
Geoff McLane 22dcea067e Issue #335, maybe #333, to output indent char, reduce if tab 2017-03-26 16:57:29 +02:00
Geoff McLane 5f88452487 Issue #333 - create exception for span/meta 2017-03-26 16:57:29 +02:00
Geoff McLane 17354ff927 Issue #515 #516 - Bump to 5.5.12 for this change 2017-03-24 15:26:09 +01:00
Geoff McLane fe3efcd035 Merge pull request #516 from htacg/cpack-test
Cpack test
2017-03-24 15:21:17 +01:00
Geoff McLane d3e8cf3901 Make LICENSE.txt equivalent to LICENSE.md 2017-03-24 15:19:07 +01:00
Geoff McLane 04f536ec5c Merge branch 'cpack-test' of github.com:htacg/tidy-html5 into cpack-test 2017-03-23 15:19:06 +01:00
Geoff McLane 03e96e36d4 Since CPack can miss some system DLLs, make option ADD_SYSTEM_RUNTIMES, def OFF 2017-03-23 15:18:19 +01:00
Geoff McLane 29f106b483 Use one compatible license file for all 2017-03-23 15:18:19 +01:00
Geoff McLane 525fe9c134 Issue #515 - Add option to use MSVC statis runtime /MT 2017-03-23 15:18:19 +01:00
Geoff McLane ba073a2882 Issue #515 - Add system DLLs to installers 2017-03-23 15:18:19 +01:00
Geoff McLane 6b0dd4131a add LICENSE.txt for WIN32 bin package 2017-03-23 15:18:19 +01:00
Geoff McLane 22bc8da583 Since CPack can miss some system DLLs, make option ADD_SYSTEM_RUNTIMES, def OFF 2017-03-23 15:13:28 +01:00
Geoff McLane 25f51604d0 Use one compatible license file for all 2017-03-23 15:05:05 +01:00
Geoff McLane 5416bfb8ae Issue #515 - Add option to use MSVC statis runtime /MT 2017-03-23 14:53:44 +01:00
Jim Derry 1a66455052 Bumped to 5.5.11 for small API change. 2017-03-22 16:14:17 -04:00
Jim Derry 5f05add439 Continue the documentation effort!
- Many, many updates to the public header files.
- tidyenum.h was reorganized substantially in order to better generate
  documentation with Doxygen.
- This was also a good time to clean up all of the various enums for languages
  and strings. Everything is simple and in a single enum now, other than a
  couple of cases (TidyOptionId, for example, doesn't need to be redefined).
- A full and complete audit of the strings meant some opportunities to delete
  useless strings.
- Reorganized the order of the strings in language_en.h in order to better
  find things when programmers want to make changes. There are a lot fewer
  internal "sections" now, and everything has been painstakingly sorted within
  the remaining sections.
- Consequently rebased all of the PO's, POT, and other language files.
- Updated several of the READMEs with the newest information.
- Made the READMEs easier to copy into the Doxygen project by changing some of
  the code format for compatibility, mainly the use of tildes instead of
  backslashes for code blocks.
- Added tidyGetMessageCode() to message API. Despite the huge diff, this is the
  only externally-visible change, other than removing some enums (but not their
  values!).
- Passing `next` tests on Mac, Linux, Win10.
2017-03-22 16:05:13 -04:00
Geoff McLane ce7b5cd55e Issue #515 - Add system DLLs to installers 2017-03-22 04:11:32 +01:00
Geoff McLane 187545771b add LICENSE.txt for WIN32 bin package 2017-03-22 04:10:13 +01:00
Geoff McLane 8de67cf4d6 Some improvement to 'build-bins.bat' - no bump 2017-03-22 02:45:43 +01:00
Geoff McLane bbb37b6354 Issue #335, maybe #333, to output indent char, reduce if tab 2017-03-20 18:40:59 +01:00
Jim Derry be5e80f5a7 Bump to 5.5.10 for small API change. 2017-03-20 12:22:45 -04:00
Jim Derry 929575afb4 Picklist enums should all start at zero for external LibTidy user compatibility.
Restore the new custom-tags enum to this state, and add separate string keys.
Updated PO's to reflect; no change to headers.
2017-03-20 12:20:51 -04:00
Geoff McLane b9d1e1f037 Issue #333 - create exception for span/meta 2017-03-20 16:54:50 +01:00
Jim Derry 0be7ed8e33 Removed TODO comment; no version bump. 2017-03-19 16:39:13 -04:00
Jim Derry 3b9fd6bd5e Bumped version to 5.5.9 to reflect latest commit. 2017-03-19 15:44:18 -04:00
Jim Derry a4f752f274 Implement TODO:
- tidyDetectedHtmlVersion()
- tidyDetectedXhtml()
- added two new fields to W3C_Doctypes[] in order to simplify this.
- added TY_(HTMLVersionNumberFromCode)() to enable lookup.
- Implement tidyDetectedGenericXml()
- Added a warning message if an XML declaration exists but the document is not
  XHTML.
- Remove dead commented code.
- Updated POs and POT. Headers not affected, but translators should check
  their translations.
- Testing is clean on Mac OS X, Ubuntu 16.04, and Windows 10.
2017-03-19 15:41:51 -04:00
Jim Derry 068e6bf42a Bumped to 5.5.8 because two new methods added during documentation updates. 2017-03-19 09:53:16 -04:00
Jim Derry 13122e8862 Added tidyErrorCodeFromKey()
Added tidyGetMessageDoc()
Improved the Public API documentation.
2017-03-19 08:15:32 -04:00
Jim Derry 1dbacc9c43 Bumped to 5.5.7 to support custom tags. 2017-03-19 08:09:43 -04:00
Jim Derry b3d6dc3d8a Merge pull request #514 from htacg/custom_tags
Support custom tags
2017-03-19 08:08:58 -04:00
Geoff McLane c8f366b76e Issue #119 - Remove 3 newline chars, that crept in... 2017-03-18 18:52:48 +01:00
Jim Derry 89e4a0215a Fixed the enum, which has TidyCustomTags and TidyUseCustomTags documented backwards. 2017-03-18 11:20:56 -04:00
Geoff McLane 73f68e2b2a Issue #119 - remove old debug code 2017-03-17 18:02:11 +01:00
Jim Derry da55a6e4ac Removed unused declaration. 2017-03-16 08:00:05 -04:00
Jim Derry 0c5550b06f I think the messages are where I want them to be. Will generate test cases
for comparison. Also regen'd all pots and language headers.
2017-03-15 17:36:05 -04:00
Geoff McLane 61692401ce Issue #119 - be able to set RC number during lib build 2017-03-15 19:57:47 +01:00
Jim Derry 5606f32f13 WIP; messaging much more logical, except @todo noted. 2017-03-14 21:50:10 -04:00
Jim Derry 66ade9def4 Still noisy, but adds HTML5 dependent output message upon detection. 2017-03-14 16:27:11 -04:00
Jim Derry ed5a1d84ea Add TY_(nodeIsAutonomousCustomTag), so we can use it elsewhere. 2017-03-14 15:44:46 -04:00
Jim Derry 8273491e16 Change allowed values for custom-tags, and make y equal to inline. 2017-03-14 15:16:11 -04:00
Jim Derry 66de84bc2b - Add support for the `is` attribute.
- Add support for autonomous custom elements.
2017-03-13 13:45:32 -04:00
Jim Derry 96bb67045f Bump to 5.5.6 for messages system update. 2017-03-13 13:31:35 -04:00
Jim Derry 11178d775b Massive Revamp of the Messaging System
This is a rather large refactoring of Tidy's messaging system. This was done
mostly to allow non-C libraries that cannot adequately take advantage of
arg_lists a chance to query report filter information for information related
to arguments used in constructing an error message.

Three main goals were in mind for this project:

- Don't change the contents of Tidy's existing output sinks. This will ensure
  that changes do no affect console Tidy users, or LibTidy users who use the
  output sinks directly. This was accomplished 100% other than some improved
  cosmetics in the output. See tidy-html5-tests repository, the `refactor` and
  `more_messages_changes` branches for these minor diffs.
- Provide an API that is simple and also extensible without having to write new
  error filters all the time. This was accomplished by adding the new message
  callback `TidyMessageCallback` that provides callback functions an opaque
  object representing the message, and an API to query the message for wanted
  details. With this, we should never have to add a new callback routine again,
  as additional API can simply be written against the opaque object.
- The API should work the same as the rest of LibTidy's API in that it's
  consistent and only uses simple types with wide interoperability with other
  languages. Thanks to @gagern who suggested the model for the API in #409.
  Although the API uses the "Tidy" way off accessing data via an iterator
  rather than an index, this can be easily abstracted in the target language.

There are two *major* API breaking changes:

- Removed TidyReportFilter2
  - This was only used by one application in the entire world, and was a hacky
    kludge that served its purpose. TidyReportCallback (né TidyReportFilter3)
    is much better. If, for some reason, this affects you, I recommend using
    TidyReportCallback instead. It's a minor change for your application.
- Renamed TidyReportFilter3 to TidyReportCallback
  - This name is much more semantic, and much more sensible in light of
    improved callback system. As the name implies, it remains capable of
    *only* receiving callbacks for Tidy "reports."

Introducing TidyMessageCallback, and a new message interrogation API.

- As its name implies, it is able to capture (and optionally suppress) *all*
  of Tidy's output, including the dialogue messages that never make it to
  the existing report filters.
- Provides an opaque `TidyMessage` and an API that can be used to query against
  it to find the juicy goodness inside.
  - For example, `tidyGetMessageOutput( tmessage )` will return the complete,
    localized message.
  - Another example, `tidyGetMessageLine( tmessage )` will return the line the
    message applies to.
- You can also get information about the individual arguments that make up a
  message. By using the `tidyGetMessageArguments( tmessage )` itorator and
  `tidyGetNextMessageArgument` you will obtain an opaque `TidyMessageArgument`
  which has its own interrogation API. For example:
    - tidyGetArgType( tmessage, &iterator );
    - tidyGetArgFormat( tmessage, &iterator );
    - tidyGetArgValueString( tmessage, &iterator );
    - …and so on.

Other major changes include refactoring `messages.c` to use the new message
"object" directly when emitting messages to the console or output sinks. This
allowed replacement of a lot of specialized functions with generalized ones.

Some of this generalizing involved modifications to the `language_xx.h` header
files, and these are all positive improvements even without the above changes.
2017-03-13 13:28:57 -04:00
Jim Derry 4dc8a2cf9a Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate
merge.
  - Sort all of the existing options and re-indent per Tidy standards. This is
    simply for cosmetic effect.
  - Allow the iterator to return all options again, even "internal" options.
    Things are too embedded with N_TIDY_OPTIONS, etc., to try to hide them.
  - Instead, simply add documentation to LibTidy users that they shouldn't use
    internal options.
  - Also added `TidyInternalCategory` to `TidyConfigCategory` without adding a
    new field to the struct. API users should check for this category before
    use.
  - Defined a two character macro for `TidyInternalCategory` for use in
    `option_defs[]`.
  - Changed struct `option_defs[]` to reflect the new category for affected
    options.
  - Removed string indicating * refers to internal options, since it no longer
    applies.
  - Regen'd all strings for previous point.
  - `tidy.c` now checks for `TidyInternalCategory` everywhere in order to
    suppress output.
2017-03-10 09:13:21 -05:00
Jim Derry 81b8ec0c90 Provide hot fix for stupid iterator errors. 2017-03-09 19:58:43 -05:00
Jim Derry ac242e9ea4 hotfix 2017-03-09 19:56:16 -05:00
Jim Derry f88328b893 hotfix 2017-03-09 19:13:45 -05:00
Jim Derry b0bd27e9c1 Bump to 5.5.4 2017-03-09 13:01:39 -05:00
Jim Derry cca276673c Merge branch 'issue_472' into next 2017-03-09 13:00:37 -05:00
Jim Derry e27cc262fe Bring the local vars into the context, which is allowed in C89. 2017-03-09 12:44:48 -05:00
Jim Derry f9f908b70a Addresses #492. 2017-03-08 16:53:59 -05:00
Jim Derry 005127c733 Address issue #472. 2017-03-08 15:37:01 -05:00
Jim Derry b047e32a18 Bump to 5.5.3. 2017-03-07 20:18:06 -05:00
Jim Derry 978756a482 Restore the previous status of `gnu-emacs-file`
- Updated strings files to match.
- Inhibit internal options from being output via the iterator. Internals should
  never have the chance to be exposed if they shouldn't be use.
- Added tidySetEmacsFile() and TidyGetEmacsFile() to the public API, and use it
  instead of secret API to set the filename in the console application.

The end result is that `gnu-emacs-file` (and also `doctype-mode`) officially no
longer exist to CLI users nor to API users, and tidy console behaves properly
by using a published API to set the filename for emacs.
2017-03-07 20:11:31 -05:00
Jim Derry 1ebae18c9a Bump to 5.5.2 2017-03-06 17:09:33 -05:00
Jim Derry 50ff29af54 Applied fix to `eqconfig` as well, which solves the man page generation issue. 2017-03-06 17:08:32 -05:00
Jim Derry 0572072148 Make sure that -xml-help uses localized names instead of format specifiers. 2017-03-06 12:12:39 -05:00
Jim Derry b5885dee46 Bump to version 5.5.1. 2017-03-06 07:07:40 -05:00
Jim Derry f3e3e1708b Merge branch 'clean_deprecations' into next 2017-03-06 07:06:28 -05:00
Geoff McLane 906f2e7f49 ignore msvc140 *.VC.db 2017-03-05 16:27:19 +01:00
Jim Derry 03f0192f51 How did this get back in there??? 2017-03-04 15:31:25 -05:00
Jim Derry 432f43dd2f Corrected description of pointer operator-macro order. 2017-03-03 07:17:28 -05:00
Jim Derry 74a4fa4049 Merge branch 'next' into clean_deprecations 2017-03-02 11:40:14 -05:00
Jim Derry ab183b8ae5 Merge pull request #503 from htacg/messages_squashed
Messages squashed
2017-03-02 09:39:19 -05:00
Jim Derry 3be515b1f9 Merge branch 'next' into messages_squashed 2017-03-02 09:34:58 -05:00
Jim Derry 92621d6f99 MSVC Compatibility
- Changed location of pointer operator in declarations.
  - Updated `CODESTYLE.md` to reflect this.
  - Updated `API_AND_NAMESPACE.md` to reflect this.
2017-03-02 09:32:02 -05:00
Geoff McLane 3e23225288 version.txt - Bump to 5.5.0 in next 2017-03-01 15:33:22 +01:00
Geoff McLane 0016e00835 Update verhist.log to 5.4.0 release 2017-03-01 15:06:30 +01:00
Geoff McLane 17b33753ae version.txt - Update to 5.4.0 release 2017-03-01 15:04:22 +01:00
Geoff McLane c39b1cb423 Issue #498 - Bump to 5.3.21 for merge #502 2017-03-01 14:51:53 +01:00
Geoff McLane 323ddacf5d Merge pull request #502 from htacg/issue-498
Issue #498 - parser.c - if a <table> in a <table> just close. This fixes #498
2017-03-01 14:47:40 +01:00
Geoff McLane 6574225f14 Merge pull request #500 from htacg/readme_540
Update README documents with information for the upcoming 5.4.0 release.
2017-03-01 14:36:59 +01:00
Jim Derry bb2cb26372 Update README documents with information for the upcoming 5.4.0 release. 2017-02-24 14:30:42 -05:00
Geoff McLane a49890ee55 Issue #498 - parser.c - if a <table> in a <table> just close.
The previous action was to discard the second, while it is the second
table that browsers will render.

This conforms to the principle that the html output by tidy should render
in a browser like the original html.
2017-02-24 16:20:10 +01:00
Geoff McLane d07134140a Issue #497 - version.txt - Bump to 5.3.20 for this fix 2017-02-24 14:39:46 +01:00
Geoff McLane c4b5904e1c Issue #497 - lexer.c - Add comment for this PR @seaburg 2017-02-24 14:38:20 +01:00
Geoff McLane e44f4d1469 Merge pull request #497 from seaburg/fix_value_trimming
Fix leading white spaces trimming
2017-02-24 14:30:39 +01:00
Geoff McLane 13c92bce38 Issue #468 - version.txt - Bump to 5.3.19 for this fix 2017-02-23 16:29:44 +01:00
Geoff McLane 27fe0548b9 Issue #468 - config.c - use `RAW` encoding for all cases 2017-02-23 16:28:19 +01:00
Geoff McLane b97b2f0d45 Issue #329 - version.txt - bump to 5.3.18 for this fix 2017-02-23 15:28:40 +01:00
Geoff McLane 569ae4b435 Issue #329 - lexer.c - do not discard this newline here 2017-02-23 15:27:03 +01:00
Evgeniy Yurtaev bb1d62d3bd Fix leading white spaces trimming 2017-02-22 14:34:40 +03:00
Jim Derry c54c10f857 - Removed deprecated options:
- TidySlideStyle
  - TidyBurstSlides

- Added documentation for TidyEmacsFile, since it's a valid option.

- Because TidyEmacsFile is a valid option, tweaked tidy.c so that it can
  be specified in a configuration file without being overwritten by the console
  app. Why a user might do this is dumb, but who are we to stop them.
2017-02-18 18:30:41 -05:00
Jim Derry edc548095c Removed language as tidy config option; it is only CLI option. 2017-02-18 17:16:35 -05:00
Jim Derry cbb8354f74 Combined leftover attribute API stuff into single, new file. 2017-02-18 16:57:11 -05:00
Jim Derry f6ce4d130e Removed deprecated tidyAttrGetSOMETHING from API. 2017-02-18 16:46:20 -05:00
Jim Derry 13c6387f47 Removed deprecated AttributeIsSOMETHING from API. 2017-02-18 16:43:47 -05:00
Jim Derry a16f36ce53 Removed deprecated NodeIsElementName from API. 2017-02-18 16:33:21 -05:00
Jim Derry 81d2d26883 Added a new README/API_AND_NAMESPACE.md, which might help and encourage
new developers to add new functionality to Tidy.
2017-02-17 19:23:26 -05:00
Jim Derry 165acc4f3e Several foundational changes preparing for release of 5.4 and future 5.5:
- Consolidated all output string definitions enums into `tidyenum.h`, which
    is where they belong, and where they have proper visibility.
  - Re-arranged `messages.c/h` with several comments useful to developers.
  - Properly added the key lookup functions and the language localization
    functions into tidy.h/tidylib.c with proper name-spacing.
  - Previous point restored a *lot* of sanity to the #include pollution that's
    been introduced in light of these.
  - Note that opaque types have been (properly) introduced. Look at the updated
    headers for `language.h`. In particular only an opaque structure is passed
    outside of LibTidy, and so use TidyLangWindowsName and TidyLangPosixName
    to poll these objects.
  - Console application updated as a result of this.
  - Removed dead code:
    - void TY_(UnknownOption)( TidyDocImpl* doc, char c );
    - void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file );
  - Redundant strings were removed with the removal of this dead code.
  - Several enums were given fixed starting values. YOUR PROGRAMS SHOULD NEVER
    depend on enum values. `TidyReportLevel` is an example of such.
  - Some enums were removed as a result of this. `TidyReportLevel` now has
    matching strings, so the redundant `TidyReportLevelStrings` was removed.
  - All of the PO's and language header files were regenerated as a result of
    the string cleanup and header cleanup.
  - Made the interface to the library version and release date consistent.
  - CMakeLists.txt now supports SUPPORT_CONSOLE_APP. The intention is to
    be able to remove console-only code from LibTidy (for LibTidy users).
  - Updated README/MESSAGES.md, which is *vastly* more simple now.
2017-02-17 15:29:26 -05:00
Jim Derry 0bd6ba30b4 Merge branch 'tidy_version'
Note: this is a triple merge. Version bumped only once.
2017-02-13 08:51:04 -05:00
Jim Derry e1f066fe14 Merge branch 'empretty_script' 2017-02-13 08:49:13 -05:00
Jim Derry b7c84b1b57 Merge branch 'surrogates' 2017-02-13 08:49:06 -05:00
Geoff McLane 73bf561645 Bump version to 5.3.16 for SPRTF fixes 2017-02-12 17:40:48 +01:00
Geoff McLane ea49ca0b1d Fix license for SPRTF modules.
Also correct the coding style to conform to HTML Tidy standard.
2017-02-12 17:38:44 +01:00
Geoff McLane 23c4686b0f Merge branch 'surrogates' of github.com:htacg/tidy-html5 into surrogates 2017-02-11 18:34:38 +01:00
Geoff McLane 7f73d4f429 Issue #483 - Add ReportSurrogateError() service and connect. 2017-02-11 18:33:45 +01:00
Jim Derry 45a6062b4a VERSION.md cleanup. 2017-02-10 14:21:24 -05:00
Jim Derry c789ca8311 Cleanup of MESSAGES.md again, this time with correct information. 2017-02-10 10:24:11 -05:00
Jim Derry 91e27b14f3 Cleaned up MESSAGES.md just a bit per Geoff's request. 2017-02-09 16:46:18 -05:00
Geoff McLane 75bc1f06c7 More updates for Issue #483 - Start warning msgs - WIP 2017-02-09 20:55:23 +01:00
Geoff McLane 3ca117550a Initial start on a README/MESSAGES.md 2017-02-09 20:54:11 +01:00
Jim Derry 1ac50fccb3 Pretty up output of empty script tags.
- No longer break script tags up on two lines if there is content. However
    output is still subject to the `--wrap` behavior.
  - Previous behavior intact if there is content.

Todo.

  - Associate this with a new Tidy option.
2017-02-08 13:53:37 -05:00
Geoff McLane 6a83918d33 Add README for new 'attributes' and 'elements', 'tags' 2017-02-05 17:27:28 +01:00
Geoff McLane 9dc76c1e77 Issue #483 - Some fixes for error condition 2017-02-02 16:43:10 +01:00
Geoff McLane 259d330780 Issue #483 - First cut dealing with 'surrogate pairs'.
Only deals with a successful case.

TODO: Maybe add a warning/error if the trailing surrogate not found, and
maybe consider substituting to avoid invalid utf-8 output.
2017-02-01 13:50:33 +01:00
Geoff McLane 10fd44d101 Issue #478 PR #480 - Bump to 5.3.15 2017-01-29 19:21:46 +01:00
Geoff McLane deebc93f97 Merge pull request #480 from onnimonni/feature-fix-xmlns-xlink
Add optional xmlns:xlink attributes as valid to support inline svg
2017-01-29 19:17:43 +01:00
Geoff McLane 0cbbd55535 Issue #463, a step in #460, bump to v.5.3.14 for this merge 2017-01-09 17:07:13 +01:00
Geoff McLane cdf3f8846c Merge pull request #463 from marcoscaceres/ansi_compliance
style: ansi conforming comments
2017-01-09 16:59:43 +01:00
Onni Hakala da27b5e339
Add optional xmlns:xlink attributes as valid to support inline svg
fixes #478
2017-01-09 01:38:16 +02:00
Geoff McLane 2243510592 Issue #469 #473 Bump to 5.3.13 2017-01-08 18:24:17 +01:00
Eric Bréchemier 7593d7b58f Merge documentation of "command-line" and "configuration" options (Issue #469) (#473)
* Track tidy.1 before merging duplicate sections

I am adding the file to the git repository to track and review
the changes to this generated file. I will then update the XSLT
transformation which produces this file to remove duplicate sections.
As a first step, I will stop outputting duplicate sections; I will
then merge them into existing sections. I will commit the changes
to the generated file at each step.

Related issue: #469

* Also track changes in text rendering of the man page tidy.1

The rendering to text was done with following command:

  /usr/bin/groff -Tascii -mandoc -c tidy.1

This format should make the review of differences more readable.

Related issue: #469

* Remove duplicate sections: temporarily discard detailed options

Related issue: #469

* Generalize command line given in SYNOPSIS

The new SYNOPSIS expresses the fact that multiple files can
be provided as argument, and that options and files can be mixed
(options apply only to the files specified after, not the ones before).

It does not explain that there are actually two types of options; this
shall be detailed afterwards: simple options (aka standard options) start
with single dash while configuration options start with a double dash.
Only the latter can be defined in configuration files, using their name
without the double dash.

I have also reformatted the terms 'options' and 'file' to be underlined,
to follow conventions that I observed in other man pages (ls, grep, wget...)

Related issue: #469

* Regroup sentences related to options at the start of OPTIONS section

This is an intermediate step before adapting the text to its new
location. I will probably start the section with a paragraph to
introduce the two different kinds of options. Then describe the
"standard" options in more details. Then list the standard options.
Then describe the configuration options in more details. Then list
the configuration options, using a format similar to the one used
for standard options.

Related issue: #469

* Describe "standard" and "expanded" options part of OPTIONS section

The section now starts with a description of both types of options,
and explains that the first part of the section concerns with the
"standard" options while the second part of the section concerns with
the "expanded" options.

More details are provided about "standard" options, which are then
listed individually.

More details are then provided about "expanded" options and their
usage on the command line and in configuration files. The configuration
options are not listed yet. In order to avoid repeating a lot of
information with every separate configuration option, I will first
describe common values and formats; I will then describe each option
more succinctly, like "standard" options.

Related issue: #469

* Remove redundant USAGE section

The fact that the input file defaults to standard input
and the output file to standard output is already indicated
in the DESCRIPTION section. This was the only information
left in this section at this point.

Related issue: #469

* Delete separation line

The line used to separate "standard" usage from "extended" usage.
Both forms are now integrated in the common description of OPTIONS.

Related issue: #469

* Delete DETAILED CONFIGURATION OPTIONS section

The detailed configuration options are now described together
with standard options in a common OPTIONS section.

Related issue: #469

* Delete duplicate SYNOPSIS section

A single generalized SYNOPSIS now encompasses both kinds of options.

Related issue: #469

* Delete WARNING section, no longer relevant

The WARNING referred to a separate section for the description
of "standard" options. They are now described in the same OPTIONS
section as "extended" options.

Related issue: #469

* Copy details of configuration options and file format to OPTIONS

Just before listing all the configuration options, this is the
expected place to describe the "extended" options in more details.
The description was already worded as an introduction to the list
of configuration options. I will update this description after having
compacted entries which describe individual configuration options.

Related issue: #469

* Delete duplicate DESCRIPTION section

This section has been merged into the generalized OPTIONS section.

Related issue: #469

* List configuration options at the end of the OPTIONS section

This list is very long, with lots of duplicate information
repeated for entries of the same type. The description of
configuration options should be compacted to match as closely
as possible the description of "standard" options.

Related issue: #469

* Delete duplicate OPTIONS section

I contained the list of configuration options, which is now included
at the end of the generalized OPTIONS section.

Related issue: #469

* Delete config-section template

The template was now empty. Its contents have been merged
into the cmdline-section template.

Related issue: #469

* Remove redundant sentence

The sentence listed the five categories of configuration options.
This kind of made sense when the options were listed in the following
section. Now that they are listed just below, it has become redundant.

Related issue: #469

* Remove colon ':' at the end of configuration options categories

The categories of "standard" options do not end with a colon;
no title does actually.

Related issue: #469

* Remove extra lines before the list of configuration options

Related issue: #469

* Add double space after period '.  ' where missing

For consistency with usage, sentences within paragraphs shall be
separated by a double space rather than a single space. This was
done in most places in the document, with only a few places missing.

Related issue: #469

* Delete irrelevant comment

The comment refers to cmdline section at the start of the processing
of configuration options. The cmdline options are opposed to
config options in the context of this transformation. They are
provided through two separate XML input files.

Related issue: #469

* Delete extra blank line before sample configuration file

Related issue: #469

* Remove multiple empty lines after heading of each options category

Related issue: #469

* Remove duplicate empty line before 'See also:' lines

Related issue: #469

* Clarify the terms used for both kinds of options

I removed references to "standard" (or regular) command-line options
and "extended" (or detailed) options. I used the terms featured in
the description of the options which output XML files describing
each kind of options:

  -xml-help
        list the command line options in XML format

  -xml-config
        list all configuration options in XML format

The term for single-dash options is now (purely) command-line options
while double-dash options are referred to as configuration options.

Related issue: #469

* Update copyright year to 2016

* Clarify configuration options equivalent to command-line options

I added a paragraph to explain the equivalence of a command-line
option with a configuration option and value, and to explicit the
format used to describe this equivalence in the description of
command-line parameters.

I moved the parentheses, which were on the last line, at the end
of the description, to the first line at the end of the list of
names for the command-line option.

Related issue: #469

* Use underlines (I) instead of bold (B) for option names in config example

This is for consistency with the format used for the option names in
the equivalent command-line example above, and in the other example
of configuration file.

Related issue: #469

* Update copyright year to 2017

* Add double dash before the name of configuration options

This is a first step for the harmonization of the descriptions
of command-line and configuration options.

Related issue: #469

* Reformat logically to separate formatting (bold) from text (option name)

Related issue: #469

* Move Type after name of configuration option

This puts it in the position expected on the command line.

Related issue: #469

* Move default value after config option name and Type

I tried different formats for the default value:

  --clean Boolean:no
  --clean Boolean[no]

and more formats after I realized that the 'default' value is
not applied when the value is omitted, but when the option is
not used at all:

  --clean Boolean (initially: no)
  --clean Boolean (unset: no)

I selected the less confusing format:

  --clean Boolean (no if unset)

which is self-explanatory.

Related issue: #469

* Clarify that a configuration option cannot be used without a value

For example, using --clean without a value is not equivalent to
using -clean option:

  curl -s https://www.google.com | tidy --clean 2>&1 1>/dev/null | head -n 1

results in:

  Config: missing or malformed argument for option: clean

Related issue: #469

* Add double dash before option names in 'See also' sections

This is consistent with the format used at the top of the
description of configuration options.

Related issue: #469

* Fix order of items in comment describing documentation of config options

The 'seealso' comes last actually, after the description.

* Break long lines to keep source code readable in a terminal (80 characters)

This makes no change on the text generated by

  /usr/bin/groff -Tascii -mandoc -c tidy.1 > tidy.1.txt

* Only output an empty line when Example section is present

Otherwise, the description starts with an empty line when
no Example section is present.

Related issue: #469

* Simplify matching of example elements with contents

Using a template match instead of a named template,
I will then add rules with higher priority to ignore
examples for certain types of values, which are very
redundant (identical for all options of the same type).

Related issue: #469

* Do not print redundant examples

Examples for Boolean and AutoBool are redundant because they are
described in the main text and identical for all options of that type.

Examples for Tag names are redundant because they are redundant
with the name of the Type, and identical for all options of that type.

Examples for Integer are redundant because they are identical for
all options of that type but one, where the value 0 is followed with
a comment, but even in this case the examples are redundant because
the comment for the value 0 is also included in the description.

Related issue: #469

* Rename 'Examples' section to 'Supported values' to clarify

I also updated the description related to 'Examples' section
in the introduction paragraphs to the configuration options.

Related issue: #469

* Use italics consistently for the names of option types

Related issue: #469

* Use capitalization with no extra style consistently for Type

Previously, a mix of

  * Type set in bold font
  * Type set in regular font
  * "types" (quoted)
  * types (unquoted)

was found. I replaced all instances by Type in regular font.

Related issue: #469

* Consistently use bold format for option values

Both parameter names and values are now in bold,
while keys and values for configuration files are in italics.

Related issue: #469

* Use the same format as other subsections for 'See also'

The subsection is now flush left, in regular font, like
the 'Supported values' subsection.

The previous format was less adequate when the list wrapped
to the next line (--new-inline-tags): wrapping started on
the very first column, breaking the alignment of the rest of
the description.

Related issue: #469

* Consistently indent with 2 spaces, use a single line between templates

Parts of the file were indented with 2 spaces, others with 3 spaces.
Parts of the templates were separated with two empty lines, others
with a single one.

* Remove temporary files used for step by step comparisons of man page

Related issue: #469
2017-01-08 18:19:36 +01:00
Marcos Caceres 91da8c6f74 style: ansi conforming comments 2016-12-20 16:51:09 +11:00
Geoff McLane fd0ccb2bbf Bad, repeated node iteration! closes #459 2016-10-30 23:37:31 +01:00
Marcos Caceres aff76bec38 fix(lexer.c): fixes from initial review 2016-10-17 17:00:58 +11:00
Marcos Caceres 523d58b004 refactor: ask for charset and http_equiv attrs 2016-10-06 19:30:23 +11:00
Marcos Caceres 932cc104a6 feat(attrask.c): learn about charset attr 2016-10-06 19:29:56 +11:00
Marcos Caceres 53ee94ddba fix: incorrect check for first element in head 2016-10-06 19:07:44 +11:00
Marcos Caceres b1629c4a4f fix(lexer): bad attribute reporting 2016-10-05 20:22:19 +11:00
Marcos Caceres 2d7ddfef94 Part 2.1 - Bug fixes and warning 2016-10-05 20:14:18 +11:00
Marcos Caceres cfc22ac46e Add garvankeeley's suggestions using calloc 2016-10-05 18:54:25 +11:00
Marcos Caceres 040c22c6dc Part 2 - Implement lexer logic 2016-10-04 21:23:57 +11:00
Marcos Caceres 169bd38adf Part 1 - Add basic infra for 'add-meta-charset' option 2016-10-04 17:56:29 +11:00
Geoff McLane 92a872251b Change to msvc140 2015 build 2016-10-02 16:37:22 +02:00
Geoff R. McLane 951a65bdcf Improve doxy comment formating - no code changes 2016-09-11 17:20:43 +02:00
Geoff McLane 4edbc2424b Issue #428 - Bump to 5.3.11 for this merge 2016-09-11 17:09:09 +02:00
Geoff McLane d81a9ad901 Merge branch 'issue-428'
Conflicts:
	version.txt

This closes #428
2016-09-11 16:57:07 +02:00
Geoff McLane f1ac2dba58 Issue #449, merge #450 - Bump to 5.3.10 for this fix. 2016-09-11 15:50:42 +02:00
Geoff McLane a820f06cc8 Merge pull request #450 from marcoscaceres/as_attribute
Add support for link 'as' attribute (closes #449)
2016-09-11 15:46:38 +02:00
Geoff McLane 59d1fe4d72 Issue #454 - Clearly show `xsltproc' prereqisite, and other additions 2016-09-10 16:01:23 +02:00
Marcos Caceres e4ae9c064d Add support for link 'as' attribute (closes #449) 2016-08-23 18:46:04 +10:00
Geoff McLane 80e57b23bf Merge branch 'master' into issue-428
Conflicts:
	version.txt
2016-08-09 00:46:40 +02:00
Geoff McLane d2fc252598 Issue #443, merge #445 - Bump to 5.3.9 for this fix 2016-08-04 15:54:14 +02:00
Geoff McLane edafefb303 Merge pull request #445 from AdamMajer/fix_buffer_overflow
Fix static buffer overrrun (issue #443)
2016-08-04 15:50:57 +02:00
Geoff McLane 7631f25ed2 rebase issue-428 2016-08-02 18:10:19 +02:00
Adam Majer 50557a4f63 Fix static buffer overrrun (issue #443)
result[6] is a fixed array of size 6, but in the process
of copying data into it, we clobber the last allocated byte.

Simplify some of the code by not calling redundant functions.
2016-08-02 11:10:45 +02:00
Geoff McLane 09caae3b9c Issue #441 - add 'integrity' attribute.
Bumped to 5.3.8 for this change...

See also #418 and the merge #442

Thanks @bdesham and @dengeist...
2016-07-29 03:12:40 +02:00
Geoff McLane 9ea2539d36 Merge pull request #442 from bdesham/add-integrity-attribute
Add support for the "integrity" attribute
2016-07-29 02:55:54 +02:00
Benjamin Esham 54179386be Add support for the "integrity" attribute
This attribute may be used on "link" and "script" elements. See
http://www.w3.org/TR/2016/REC-SRI-20160623/#element-interface-extensions
2016-07-24 10:24:30 -04:00
Geoff McLane b26271e3f8 Adjust for removal of LICENSE.txt 2016-07-11 20:40:20 +02:00
Geoff McLane 4a483fd066 Issue #433 #429 #426 - bump to 5.3.7 - avoid crash when no doc
This bump also includes merge of #424 - licence fix, and #423 - add
__GLIBC__ to long HAS_FUTIME list.

And coincidentally #427 - an improved french translation!
2016-07-11 15:40:08 +02:00
Geoff McLane fa9472abec Merge pull request #433 from nijel/fix-crash-upstream
Avoid crash in tidyCleanAndRepair if document was not loaded
2016-07-11 15:22:08 +02:00
Geoff McLane 0d25772a93 Merge pull request #424 from danielhjames/patch-1
Update LICENSE.md
2016-07-11 15:20:27 +02:00
Geoff McLane f84effb1f5 Merge pull request #423 from pinotree/glibc
Set HAS_FUTIME=0 on any GNU libc platform
2016-07-11 15:17:42 +02:00
Geoff McLane 2b19d32a62 Merge pull request #427 from vargenau/master
Improve French translation.
2016-07-11 15:12:52 +02:00
Geoff McLane 3b73cc12c5 Issue #420 - Bump to 5.3.6 for this merge 2016-07-11 00:26:07 +02:00
Geoff McLane 517a2ea72d Merge pull request #420 from AdamMajer/compat_headers
Add compatibility headers
2016-07-11 00:23:01 +02:00
Michal Čihař 10281040ca Avoid crash in tidyCleanAndRepair if document was not loaded
These services can only be used when there is a document loaded, ie a
lexer created.  But really should not be calling a Clean and Repair
service with no doc!
2016-07-07 16:38:05 +02:00
Geoff McLane 685f7a6c5b Issue #428 - Avoid adding form to input if html5 2016-07-02 20:13:01 +02:00
Geoff McLane d332908e5d Issue #418 - Bump to 5.3.5 for this enum fix 2016-07-01 15:54:10 +02:00
Geoff McLane 8745f79177 Issue #418 - Ensure TidyAttrID enum exactly matches table.
The file tidyenum.h has an attribute ID enumeration that must exactly
match the attribute_defs[] table in attrs.c.

Originally some attempt was made to keep this enum in some sort of order
but that should now be totally abandonned. Any 'new' attribute
enumerations should be added just above the last N_TIDY_ATTRIBS, and
likewise in the table, to avoid this problem.
2016-07-01 15:52:02 +02:00
Daniel James fa06c0f44a Merge the two different license files and add contributors 2016-07-01 10:15:26 +01:00
Geoff McLane 6b3b1624ea Issue #422 - Bump to 5.3.4 for this fix. 2016-06-30 18:36:10 +02:00
Geoff McLane 7bec2c2082 Merge pull request #422 from sesom42/master
prevent buffer overflow in debug output
2016-06-30 18:32:55 +02:00
Marc-Etienne Vargenau fb10e80099 Improve French translation. 2016-06-29 18:12:26 +02:00
Adam Majer 30cc376f7b Add compatibility headers
In older versions of tidy, these headers were defined. Now, they are
renamed to tidybuffio.h and tidyplatform.h. This may be more of a
consistent naming scheme, but it breaks current software.

Re-add these headers and add compile time warning when such a header
is used.
2016-06-28 10:27:51 +02:00
Daniel James 5b23fd2f7d Update LICENSE.md
Change date to match LICENSE.txt
2016-06-27 15:18:10 +01:00
Pino Toscano 27143cc88e Set HAS_FUTIME=0 on any GNU libc platform
GNU libc does not have <sys/utime.h> but <utime.h>, so set HAS_FUTIME=0
for it; fixes build on non-Linux platforms using GNU libc.
2016-06-24 23:45:10 +02:00
Geoff McLane eca7688941 Issue #410 - Bump to 5.3.3 for this fix. 2016-06-18 18:57:09 +02:00
Geoff McLane 97700044ce Merge pull request #410 from gagern/varargs
Pair va_copy calls with va_end
2016-06-18 18:53:53 +02:00
Geoff McLane 676b36eff5 Issue #418 - add crossorigin attributes 2016-06-18 18:26:23 +02:00
Geoff McLane a734be5bdb Merge pull request #418 from bdesham/add-crossorigin-attribute
Add support for the HTML5 "crossorigin" attribute
2016-06-18 18:23:37 +02:00
Jens Tautenhahn 84fc451a78 prevent buffer overflow in debug output 2016-06-14 15:42:18 +02:00
Benjamin Esham 941b763a8d Add support for "crossorigin" on audio too 2016-06-08 19:40:15 -04:00
Benjamin Esham d9d8e92e52 Allow "crossorigin" on img, script, and video tags too 2016-06-07 22:29:57 -04:00
Benjamin Esham 9377f65f89 Add support for the HTML5 "crossorigin" attribute
This attribute can only be used on "link" elements.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Attributes
2016-06-07 22:20:10 -04:00
Martin von Gagern 04bc8d3195 Pair va_copy calls with va_end
According to the specs, each va_copy call should be matched by a va_end call
to ensure proper cleanup.  Furthermore, since message filters might iterate
over the list of arguments, we should hand a new copy to each filter.
2016-05-17 22:37:32 +02:00
Geoff McLane 60c1dd1744 Issue #396, #398 - Bump version.txt to 5.3.1 for this merge 2016-04-16 20:16:50 +02:00
Geoff McLane 0ab4c48711 Merge pull request #398 from rtack/issue-396
allow zero LI in UL when html5. fix for #396
2016-04-16 20:14:22 +02:00
Raphael Ackermann b704a4d0d4 allow zero LI in UL when html5. fix for #396 2016-04-08 23:08:56 +02:00
Geoff McLane fdf2169ebf Issue #394 - master reset to 5.3.0 2016-04-07 16:36:06 +02:00
Geoff McLane 0db9b32e22 Issue #390 - Bump to 5.1.52 for this indent fix 2016-04-04 18:14:33 +02:00
Geoff McLane 61a0a331fc Issue #390 - fix indent with --hide-endtags yes.
The problem was, with --hide-endtags yes, a conditional pprint buffer
flush had nothing to flush, thus the indent was not adjusted.

To track down this bug added a lot of MSVC Debug code, but is only
existing if some additional items defined, so has no effect on the release
code.

This, what feels like a good fix, was first reported about 12 years ago by
@OlafvdSpek in SF Bugs 563. Hopefully finally closed.
2016-04-04 18:13:08 +02:00
Geoff McLane 7598fdfff2 avoid DEBUG duplicate newline 2016-04-03 17:54:46 +02:00
Geoff McLane 3e5e07ea18 Issue #369 - Bump to version 5.1.51 2016-03-31 14:50:47 +02:00
Geoff McLane 7777a71913 Issue #369 - Remove Debug asserts 2016-03-31 14:50:03 +02:00
Geoff rpi McLane 086e4c948c remove gcc comment warning 2016-03-30 15:02:19 +00:00
Geoff McLane 005f36106a Issue #377 - Bump version to 5.1.50 2016-03-30 16:28:45 +02:00
Geoff McLane 59d6fc7022 Issue #377 - If version XHTML5 available, return that. 2016-03-30 16:28:08 +02:00
Geoff McLane cd08a709db Some improvements in build-me.bat 2016-03-30 15:16:44 +02:00
Geoff McLane d9ce0fc078 Some improvements in build-me.bat 2016-03-30 15:01:40 +02:00
Geoff McLane c19d221ddc Issue #384 - bump to 5.1.49 2016-03-30 14:19:07 +02:00
Geoff McLane 1830fdb97c Issue #384 - insert comments 2016-03-30 14:18:04 +02:00
Geoff McLane 4b135d9b47 Merge pull request #384 from seaburg/master
Fix skipping parsing character
2016-03-30 14:08:40 +02:00
Geoff McLane aa1fc197d5 Issue #383 - Bump to 5.1.48 on this merge 2016-03-27 19:57:41 +02:00
Geoff McLane e87f26c247 Merge pull request #388 from htacg/fr.po
Merge fr.po to master
2016-03-27 19:54:54 +02:00
Geoff McLane 193320571b add WIP fr.po 2016-03-26 20:20:42 +01:00
Jim Derry 7d2ddee775 Add new `rebase` command to CLI.
This is intended to make it very, very easy to update the POT and all of the POs when
changes are made to `language_en.h`. Used without an sha-1 hash, untranslated strings
(i.e., the "source" strings) are updated in the POT/PO's.

However if you specify an --sha=HASH (or -c HASH) option, then the script will use git
to examine the `language_en.h` file from that specified commit, determing the strings
that have changed, and mark all of these strings as `fuzzy` in the POs. This will serve
as a flag to translators that the original has changed. In addition, this `fuzzy` flag
will appear in the headers as "(fuzzy) " in the item comments.

If a translator edits the header directly, he should remove the "(fuzzy )" in the
comment. Then when the PO is rebuilt, the fuzzy flag will be removed automatically.
The reverse is also true; if a translator is working with the PO, he or she should
clear the fuzzy flag and the comment will be adjusted accordingly in the generated
header.
2016-03-25 09:21:21 +08:00
Geoff McLane a15f97ebcb Merge branch 'fr.po' of github.com:htacg/tidy-html5 into fr.po 2016-03-24 14:18:06 +01:00
Geoff McLane fb95ea2ed2 Issue #383 - Bump version to 5.1.47fr 2016-03-24 14:15:44 +01:00
Geoff McLane 8671544beb Issue #383 - Add a WIP language_fr.h to facilitate testing 2016-03-24 14:15:43 +01:00
Geoff McLane 5feca8cfd6 Issue #383 - correct another byte-by-byte output to message file.
As in the previous case these messages are already valid utf-8 text, and
thus, if output on a byte-by-byte basis, must not use WriteChar, except
for the EOL char.

Of course this output can be to either a user ouput file, if configured,
otherwise stderr.
2016-03-24 14:15:43 +01:00
Jim Derry ad7bdee3b9 Added translator comments to new TidyEscapeScripts option, and updated POT and POs to reflect this. 2016-03-24 11:00:47 +08:00
Jim Derry a353523873 Spaceing 2016-03-24 10:40:21 +08:00
Jim Derry d0ec84c169 Merge branch 'master' into lang_help_enhance 2016-03-24 10:37:37 +08:00
Jim Derry 9ecdf30774 Localization fixes:
- Correct format specifiers.
- Fix missing trailing quote if following escaped quote. #385
- Don't put developer comments into generated headers unless --force-comments is used.
- Ruby 1.9.3 fix.
- Initial fuzzy support.
- Fix two character lang codes not working.
2016-03-24 10:31:56 +08:00
Geoff McLane d20822230d Issue #383 - Bump version to 5.1.47fr 2016-03-23 19:53:51 +01:00
Geoff McLane df4174f5fa Issue #383 - Add a WIP language_fr.h to facilitate testing 2016-03-23 19:52:56 +01:00
Geoff McLane 6cda2e02c8 Issue #383 - correct another byte-by-byte output to message file.
As in the previous case these messages are already valid utf-8 text, and
thus, if output on a byte-by-byte basis, must not use WriteChar, except
for the EOL char.

Of course this output can be to either a user ouput file, if configured,
otherwise stderr.
2016-03-23 19:49:17 +01:00
Jim Derry 71d6ca1392 Oops. Didn't commit es changes. This fixes that. 2016-03-23 15:10:07 +08:00
Jim Derry d54785c933 language help enhancements:
- Show the language Tidy is using.
- Update the POT and POs with the modified string.
- Regen language_es.h, which uses the string.

Note that the new header uses the new commentless behavior that's still
pending in another branch. In addition the proper c style hints have
been added to all PO's, as their previous absense was a bug.
2016-03-23 14:56:36 +08:00
Jim Derry 2cf03f7fa9 Fix two character lang codes not working. 2016-03-23 14:38:17 +08:00
Jim Derry ee151f07f1 Ruby 1.9.3 fix. 2016-03-23 13:27:17 +08:00
Jim Derry 39e4f16b48 Don't put developer comments into generated headers unless --force-comments is used. 2016-03-22 11:26:32 +08:00
Jim Derry 3cd1a87c44 Fix missing trailing quote if following escaped quote. #385 2016-03-22 11:01:41 +08:00
Jim Derry 91e8e6bf1e Correct format specifiers. 2016-03-22 10:35:03 +08:00
Geoff McLane a5ae647ee3 Issue #348 - Add README/OTPIONS.md on adding a new option 2016-03-20 01:05:36 +01:00
Geoff McLane 3c8d9bf3f6 Issue #348 - Bump to version 5.1.47 2016-03-20 01:03:25 +01:00
Geoff McLane 000c6925bd Issue #348 - Add option 'escape-script', def = yes 2016-03-20 01:01:46 +01:00
Geoff R. McLane e4bf52c516 add a rentidy.sh script to keep old versions 2016-03-19 19:56:27 +01:00
Geoff McLane 9e28261c71 ignore vc 2008 vcproj files 2016-03-19 19:49:58 +01:00
Geoff McLane 8a31aad0e3 Issues #379 #380 #383 - Bump to 5.1.46 for this merge of 'issue-380' 2016-03-19 19:32:39 +01:00
Geoff McLane 370dab3b05 Merge pull request #382 from htacg/issue-380
Merge Issue 378 and 380
2016-03-19 19:28:55 +01:00
Geoff McLane 06215769aa Issue #383 - Bump version 5.1.45-Exp3 2016-03-18 18:48:08 +01:00
Geoff McLane e6f1533d89 Issue #383 - Output message file text byte-by-byte 2016-03-18 18:47:00 +01:00
Evgeniy Yurtaev 7d28b21e60 Fix skipping parsing character 2016-03-17 23:30:11 +03:00
Jim Derry 9a9acf29cb Updated broken links in readme. 2016-03-11 16:39:17 +08:00
Geoff McLane 68e69d54a0 Merge branch 'master' of github.com:htacg/tidy-html5 2016-03-06 17:39:32 +01:00
Geoff McLane 98f32ddebb Issue #379 - Bump to version 5.1.45-Exp2 2016-03-06 17:38:48 +01:00
Geoff McLane 8dda04f1df Issue #379 - Care about 'ix' going negative.
How this lasted so long in the code is a mystery! But of course it will
only be a read out-of-bounds if testing the first character in the lexer,
and it is a spacey char.

A big thanks to @gaa-cifasis for running ASAN tests on Tidy.
2016-03-06 17:36:51 +01:00
Geoff McLane b83d5ffb03 Issue #380 - Bump to version 5.1.45-Exp1 2016-03-05 17:40:32 +01:00
Geoff McLane 8eee85cb9e Issue #380 - Experimental patch in issue-380 branch 2016-03-05 17:39:14 +01:00
Geoff McLane b2c591c138 Issue #380 - Bump version to 5.1.45
Added more debug code to try to track this bug!
2016-03-04 19:41:07 +01:00
Geoff McLane ca90fadb34 Issue #380 - Bump version to 5.1.45
Added more debug code to try to track this bug!
2016-03-04 19:39:36 +01:00
Geoff McLane 0e6ed639d6 Issue #380 - Add more MSVC debug 2016-03-04 19:28:49 +01:00
Geoff McLane d091027089 Issue #377 add debug only output of constrained versions 2016-03-03 20:21:35 +01:00
Geoff McLane 1dd06aa4b2 Issue #377 - Bump to 5.1.44 for this fix 2016-02-29 19:59:41 +01:00
Geoff McLane 7bdc31af76 Issue #377 - Table summary attribute also applies to XHTML5 2016-02-29 19:58:55 +01:00
Geoff McLane 9a80938246 Issue #314 - Bump to 5.1.43 for fix 2016-02-29 18:49:52 +01:00
Geoff McLane 24c62cf0df Issue #314 - Avoid head warning if show-body-only 2016-02-29 18:49:15 +01:00
Geoff McLane b41318724c Issue #373 - bump version to 5.1.42 for this merge of branch 373 2016-02-24 19:24:46 +01:00
Geoff McLane 771b5607f2 Merge pull request #375 from htacg/issue-373
Issue 373
2016-02-24 19:21:26 +01:00
Geoff McLane 23e689d145 Issue #373 - Merge branch 'issue-373' of github.com:htacg/tidy-html5 into issue-373
Conflicts: version.txt - set version 5.1.41issue-373
2016-02-18 15:18:39 +01:00
Geoff McLane 9ba80b864e Issue #373 - Rebase of issue-373 branch to master
Updated version.txt to 5.1.41issue-373
2016-02-18 15:14:10 +01:00
Geoff McLane 8c13d270ed Merge branch 'master' of github.com:htacg/tidy-html5 2016-02-18 13:58:23 +01:00
Geoff McLane b91d52592b Fix to K&R C to compile with MSVC 2016-02-18 13:57:47 +01:00
Jim Derry 63c0327de1 Fixed typo in output strings. 2016-02-18 15:40:10 +08:00
Jim Derry be0e5f3a8b External API merits patch bump. 2016-02-18 10:20:40 +08:00
Jim Derry e00f419f5d Discovered some missing strings from tidyErrorFilterKeysStruct. 2016-02-18 10:19:57 +08:00
Jim Derry da8205b2dc Regen'd POT, POs, and headers in order to capture documentation changes in all of them. 2016-02-17 20:07:00 +08:00
Jim Derry 7fbe76be0b Finished semantic html. 2016-02-17 20:02:38 +08:00
Jim Derry a78daccd3c Through TidyIndentSpaces. 2016-02-17 17:43:09 +08:00
Jim Derry a16e89c4f8 Updated translator comments. 2016-02-17 17:27:57 +08:00
Jim Derry d30c2d7747 XSL for man handles <var>. Updated comment and sample string. 2016-02-17 17:20:02 +08:00
Jim Derry f76c261523 Tidy should only generate valid XML in console output, too. 2016-02-17 15:56:21 +08:00
Jim Derry f62e59d813 Correct CDATA declaration. 2016-02-17 14:17:18 +08:00
Jim Derry 6c181d5689 Version bump, since we changed console API a bit. 2016-02-17 12:43:44 +08:00
Jim Derry cc59efb23d Add a `xml-error-strings` service to console app providing symbols developers can use with TidyErrorFilter3. 2016-02-17 12:35:20 +08:00
Jim Derry bc1e54d5b5 Externalize the TidyReportFilter3 error codes, and provide iterators to loop through them. 2016-02-17 12:27:11 +08:00
Jim Derry b4d2bdf3bf _Also_ output the raw option description in the -xml-options-strings service.
Improve documentation.
2016-02-17 11:20:28 +08:00
Jim Derry 720d5c25d2 Squelch compiler warning default type. 2016-02-17 10:56:21 +08:00
Jim Derry 7b8019c6ef Regenerated PO's for new strings. 2016-02-16 11:46:20 +08:00
Jim Derry 7246c7e3dc Regenered POT for new strings. 2016-02-16 11:44:50 +08:00
Jim Derry dc15acb0f3 Remove /test/ from the repository. Regression testing is still very important, and so
tests and tools will be migrated to a separate development repository.
2016-02-16 11:20:22 +08:00
Jim Derry 468cc02cf3 Merge pull request #372 from htacg/attrdict_phase2
Attrdict phase2 - enforce strict tags and attributes
2016-02-16 11:12:32 +08:00
Jim Derry 97abad0c05 Bump to 5.1.39 for merging.
Merge branch 'master' into attrdict_phase2
2016-02-16 11:11:36 +08:00
Jim Derry 813b12640e Merge pull request #370 from htacg/attrdict_phase1
Address #346 and shrink attrdict.c.
2016-02-16 11:08:53 +08:00
Jim Derry 3431dd05a4 Merge branch 'master' into attrdict_phase1
Bump version to 5.1.38
2016-02-16 11:07:32 +08:00
Jim Derry 7df66c45da Update version.txt 2016-02-16 10:20:34 +08:00
Jim Derry a95536394d Bump to 5.1.37 2016-02-16 10:19:06 +08:00
Jim Derry 1e4f7dd0f1 Merge pull request #368 from htacg/issue-341
Issue #341
2016-02-16 10:18:26 +08:00
Jim Derry cf1adc6d9d Merge pull request #366 from hguemar/master
Fix RPM generation
2016-02-16 10:16:46 +08:00
Geoff McLane 9cf97d536b Issue #373 - Avoid a null added to output.
This bug was first openned in 2009 by Christophe Chenon, as bug sf905 but
the patch provided then never made it into the source.

Now appears fixed, 7 years later!
2016-02-15 13:02:10 +01:00
Geoff McLane a4f425546f Improve MSVC DEBUG output.
Previous only output the first 8 characters, followed by an elipse if more
than 8. Now return first up to 19 chars. If nore than 19, return first 8,
followed by an elipse, followed by the last 8 characters.

This is in the get_text_string service, which is only used if MSVC and not
NDEBUG.
2016-02-14 18:17:46 +01:00
Geoff McLane c66bb848f2 Improve tidySaveString API documentation.
This was suggested by Kevin Locke back in SF bug 917 Nov, 2009. Has taken
some time to filter through!
2016-02-13 18:38:25 +01:00
Jim Derry c62127b9bd Default to NO at this point. 2016-02-13 12:33:02 +08:00
Jim Derry 8b5771cf24 Word2000
Added messages that would otherwise be missed in post-processing, after cleanup.
2016-02-13 12:26:19 +08:00
Jim Derry 2cdedb4a63 Forgot one file... 2016-02-13 11:53:53 +08:00
Jim Derry 896b00238b Forgot one file... 2016-02-13 11:53:40 +08:00
Jim Derry 2ade3357a9 Phase 2
This is a MUCH SANER approach to what I was trying to do (now that I screwed up enough internals to understand some of them!
At this point there are zero exit state reversions, and zero markup reversions! There are still 21 errout reversions; I'll
annotate and adjust as necessary.
2016-02-13 11:31:16 +08:00
Jim Derry e947d296e4 Handle some issues with misusing VERS_HTML5 in the doctype. 2016-02-12 20:49:14 +08:00
Jim Derry c81a151da5 Add VERS_STRICT to identify future strict document types. 2016-02-12 20:46:49 +08:00
Jim Derry 74604fd52b Hard-coded checks are redundant with updates to `attrdict.c`. 2016-02-12 20:44:03 +08:00
Jim Derry 429703dce4 Because the previous effort #350 grew too fast and there was a LOT of side effects to
my changes, I'm starting over with this. Comments in the PR thread.

This commit reduces the size of attrdict.c while causing only a single errout
regression that is justified.
2016-02-12 19:34:19 +08:00
Geoff McLane 03a643f781 Issue #341 - No token can be inserted if istacksize == 0! 2016-02-08 15:12:23 +01:00
Geoff McLane 58229b7e24 Issue #341 - Bump to version 5.1.37Test for this fix 2016-02-08 15:10:38 +01:00
Jim Derry fbde392af3 - Removed documentation generation from this repository.
- Removed documentation generation from CMake.
- These functions are now available in the api repository.
- Changed documentation directory to man to better illustrate its purpose.
2016-02-05 14:59:12 +08:00
Haikel Guemar 593e1df6ec Fix RPM generation
CPack generated RPM failed to install due to the RPM
owning directories owned by filesystem packages.
Exclude mandir directories from CPack.

Resolves https://github.com/htacg/tidy-html5/issues/364
2016-02-04 08:40:49 +01:00
Geoff McLane 0f3cab930a Issue #345 - bump to 5.1.36 for this fix 2016-02-01 20:10:23 +01:00
Geoff McLane 7d0d8a853a Issue #345 - discard leading spaces in href 2016-02-01 20:07:55 +01:00
Geoff McLane e8ca2aa5f3 Issue #342 - bump to version 5.1.35 for this fix 2016-02-01 19:45:43 +01:00
Geoff McLane 7f0d5c31e6 If no doctype, allow user doctype to reset table - Issue #342 2016-02-01 19:44:30 +01:00
Geoff McLane 6abb8b7a3c Add new primary language_en.h to sources.
Add the ever present language_en.h to the sources. This does nothing
really, but is important in MSVC IDE project source searches.

Also added win32tc.h even though it is not presently used.
2016-02-01 19:30:56 +01:00
Geoff McLane c1f94c066c Tidy up some debug only code.
After @sria91 added #360 merge, added a little more improvement...
2016-01-30 20:51:27 +01:00
Geoff McLane 328308cbb5 Merge pull request #360 from sria91/master
fixed a NULL node bug in debug build
2016-01-30 20:31:32 +01:00
Srikanth Anantharam 9a0af48a4e fixed a NULL node bug in debug build 2016-01-30 22:03:52 +05:30
Jim Derry 22998e81e8 Merge pull request #359 from htacg/localize_rc
HTML Tidy now can be localized.
2016-01-30 16:02:39 +08:00
Jim Derry dca50d4077 Version bump prior to rolling into master. 2016-01-30 16:02:00 +08:00
Jim Derry 3553cbab1f One more README update. 2016-01-30 15:52:16 +08:00
Jim Derry 9ae15f45a7 Consistent tabs
Fixed tabs in template file, and regen'd all related files.
2016-01-30 15:51:54 +08:00
Jim Derry 53f2a2da2a msgunfmt works properly with escaped hex. 2016-01-30 15:51:53 +08:00
Martin von Gagern 17e50f2642 Encode UTF-8 strings to hex escapes in header files 2016-01-30 15:51:53 +08:00
Jim Derry bf70824cc2 - Add TidyReportFilter3, which removes translation strings completely from the equation. It would be a good idea to deprecate TidyReportFilter2, which is vulnerable to changing strings in Tidy source.
- Documentation reminders for future enum changes.
- Documentation updates.
2016-01-30 15:51:53 +08:00
Jim Derry d505869910 Localization Support added to HTML Tidy
- Languages can now be added to Tidy using standard toolchains.
- Tidy's help output is improved with new options and some reorganization.
2016-01-30 15:51:53 +08:00
Jim Derry 7b09caee37 Merge pull request #351 from josephgrossberg/master
looks like a pre-processor left "; eof" in some of the outputted mark…
2016-01-21 17:05:04 +08:00
Joe Grossberg a81885d154 looks like a pre-processor left "; eof" in some of the outputted markdown files 2016-01-20 16:53:00 -08:00
Jim Derry ce6c7de2d9 Bump version for Mac OS X Fix, addresses #339. 2016-01-07 11:52:58 +08:00
Jim Derry 680adfd964 Merge pull request #340 from htacg/encoding_fixes
Fixes Mac OS X encoding issues and harmonizes output across platforms.
2016-01-07 11:51:46 +08:00
Jim Derry 26e7d9d4b0 Fixes Mac OS X encoding issues and harmonizes output across platforms.
Previously Tidy produced different output based on the compilation target, NOT based on
the file encoding and specified options. Every platform was equal except Mac OS. Now unless
the encoding is specifically set to a Mac file type, all encoding assumptions are the same
across platforms.
2015-12-31 13:57:34 +08:00
Geoff McLane 0005841cfe Drop back to 2.8.7 for Travis CI use 2015-12-23 00:51:01 +01:00
Geoff McLane 2dd699940b Add W3C validation for sample html 2015-12-08 01:29:39 +01:00
Geoff McLane 9942856164 Issue #308 - Bump version to 5.1.32 2015-12-07 12:42:13 +01:00
Geoff McLane 48fbcbfa78 Merge branch 'issue-308' to fix warning and release memory (#308) 2015-12-07 12:39:01 +01:00
Geoff McLane 0c6ccd884a Some additions to CONTRIBUTING.md 2015-12-06 18:55:03 +01:00
Geoff McLane b206331c55 Merge branch 'issue-308' of github.com:htacg/tidy-html5 into issue-308 2015-12-05 17:03:33 +01:00
Geoff McLane 902c961619 Some updates of the README.md 2015-12-05 17:01:31 +01:00
Geoff R. McLane d68e9c45d0 Merge branch 'master' of github.com:htacg/tidy-html5 2015-12-05 16:22:45 +01:00
Geoff R. McLane 59f60d1a79 update test 443576 msg 2015-12-05 16:22:18 +01:00
Geoff McLane 78f2d52cdd Issue #308 - remove bad warn, bad assert, and free discarded 2015-12-05 15:03:41 +01:00
Geoff McLane e0fdbba8b0 For test 500236 need .xml extent 2015-12-05 14:28:46 +01:00
Geoff R. McLane 8f8f40fe52 for test 500236 need .xml extent 2015-12-05 14:27:16 +01:00
Geoff McLane 7f131d3c79 Update to new INSERTING_AUTO_ATTRIBUTE message - #324 #320 2015-12-05 13:48:13 +01:00
Geoff McLane 5f8aac98df Reverted #327 bumped to 5.1.31 2015-12-05 13:02:33 +01:00
Geoff McLane 9caecb80cf Revert "Fix for head closing tag not reported (#327)"
This reverts commit 61cfcb1555.

This added an inconsistent warning about a missing optional close tag. In
general tidy does not report such optional close tags. See issue #327 for
some discussion on this.
2015-12-05 12:59:43 +01:00
Geoff McLane 121fe86bc6 Issue #326 - Bump to version 5.1.30 2015-12-04 18:32:48 +01:00
Geoff McLane e5038f0bc9 Issue #326 - Allow linkage choice TIDY_CONSOLE_SHARED 2015-12-04 18:31:24 +01:00
Geoff McLane 34eb16b5da Merge MinGW_build branch to version 5.1.29 (#311)
Added support for the __MINGW32__ macro of the MinGW (gcc) compiler.

Small WIN32 code changes where some MS specific defines and API
extensions needed to fall back to the normal API.

Removed the MinGW build version extension. In distribution this is a well
formed WIN32 app, perhaps renamed to tidy-MinGW.exe.
2015-12-03 19:49:24 +01:00
Geoff McLane 1c6069ae99 Remove MinGW compile rc (#311) 2015-12-03 19:36:24 +01:00
Geoff McLane 3b13cd8076 Merge branch 'mingw-build' 2015-12-03 19:18:07 +01:00
Geoff McLane 885e85d0a2 Issue #308 - remove bad warn, bad assert, and free discarded 2015-11-30 17:55:50 +01:00
Geoff McLane b2c806063a Kick '5' off name 2015-11-29 13:03:05 +01:00
Jim Derry 4c848c57bc Bumped version. 2015-11-29 13:24:01 +08:00
Jim Derry 61cfcb1555 Fix for head closing tag not reported (#327) 2015-11-29 13:21:49 +08:00
Jim Derry 3708d429bc Merge pull request #325 from htacg/progress_callback
Progress callback
2015-11-29 12:48:22 +08:00
Jim Derry 873794162a Callback added to XML printer, too; fixed off-by-one error. 2015-11-29 07:39:33 +08:00
Geoff McLane 77e053d582 Issue #311 - Add MinGW to the version 2015-11-28 15:25:24 +01:00
Geoff McLane dc969f30d5 Issue #311 - small changes for MinGW32 build 2015-11-28 15:14:53 +01:00
Jim Derry 3b8ad7482e This is probably best as void. 2015-11-28 16:02:35 +08:00
Jim Derry 4adc07fd65 Removed the one callback per line filter. Library user can filter this himself. 2015-11-28 15:43:34 +08:00
Jim Derry dcd8f16f73 Tidying progress callback implemented. 2015-11-28 15:34:23 +08:00
Jim Derry 34d456aa80 Make pretty printer keep track of line numbers as it prints. 2015-11-28 14:16:17 +08:00
Jim Derry dd4eb46bb3 Make the new README less annoying. 2015-11-27 09:50:33 +08:00
Jim Derry 501c3fb616 Version bump given the different output now produced. 2015-11-27 09:47:09 +08:00
Jim Derry 3a3836618b Merge pull request #324 from htacg/fix_img_alt
- Addresses #320
2015-11-27 09:46:17 +08:00
Jim Derry 9834cc17ad Style cleanup for previous commit. 2015-11-27 09:45:26 +08:00
Jim Derry 1c963acb58 Merge branch 'master' into fix_img_alt 2015-11-27 09:36:32 +08:00
Jim Derry c65cf43061 Merge pull request #323 from htacg/squelch_null_prefix
Allows null value css-prefix to be used in a config file without issu…
2015-11-27 09:04:19 +08:00
Jim Derry 933fc3d236 - Addresses #320
- Different error output depending on whether or not the `alt-text` option was given a value.
2015-11-26 13:23:43 +08:00
Jim Derry 63234735d8 Allows null value css-prefix to be used in a config file without issuing a warning. 2015-11-26 11:21:48 +08:00
Geoff McLane db4f6473ed Issue #321 - bump v 5.1.27 for #322 PR - thanks 2015-11-26 00:58:07 +01:00
Geoff McLane 2522730e3c Merge pull request #322 from benkasminbullock/master
Don't push back non-A tokens.
2015-11-26 00:54:55 +01:00
Ben Bullock 71d9638448 Don't push back non-A tokens. 2015-11-25 18:00:45 +09:00
Geoff McLane 0ef4493ae8 Issue #319 - bump to 5.1.26 for merge of buffer fix 2015-11-24 19:29:52 +01:00
Geoff McLane b8e4f6e21e Merge pull request #319 from CMB/memfix
Fix a tiny buffer overflow.
2015-11-24 19:21:28 +01:00
Christopher Brannon 1ef5ba7968 Fix a tiny buffer overflow. 2015-11-23 12:28:00 -08:00
Geoff McLane f567088a68 Update verhist.log to 5.1.25 2015-11-23 16:07:04 +01:00
Geoff McLane b58aa1c26a Issue #307 - add a ref link in comments 2015-11-22 20:43:12 +01:00
Geoff McLane 2388fb0175 Issue #307, #167, #169 - regression of nestd anchors 2015-11-22 18:46:00 +01:00
Geoff McLane 496c81c48d Issue #302 - bump to 5.1.24 for this fix 2015-11-18 20:02:54 +01:00
Geoff McLane bbc72a9297 Issue #306 - fix an old typo hidden by a cast!
Thanks to @benkasminbullock for spotting this fix.
2015-11-18 20:01:21 +01:00
Geoff McLane 06e4311189 bump version to 5.1.23 for 2 ggc warning fixes 2015-11-18 17:08:26 +01:00
Geoff McLane e2feed485c gcc warning - if 0 an unused static table 2015-11-18 17:06:13 +01:00
Geoff R. McLane b98061ff62 fix gcc warning parentheses in pprint.c 2015-11-18 16:47:58 +01:00
Geoff McLane 768ad46968 Issue #304 - remove duplicated TidyAttr_ARIA_ORIENTATION 2015-11-17 15:06:23 +01:00
Geoff McLane 15563fff51 Issue #303 #292 #209 - bump version 5.1.22 for intial RDFa support 2015-11-16 18:55:20 +01:00
Geoff McLane f8ca7f8112 Merge pull request #303 from halindrome/rdfa2
Rdfa2
2015-11-16 18:48:27 +01:00
Shane McCarron c0b769c5c7 Initial cut at RDFa support (again)
New branch that implements support for RDFa attributes.  Should be
cleaner than my first attempt in PR #299 - also references issue #209
2015-11-16 11:29:23 -06:00
Shane McCarron 2bbc751599 Merge remote branch 'upstream/master' 2015-11-16 11:17:14 -06:00
Shane McCarron e2ac9e68f6 Revert "Integrated portability changes and fixed version issues"
This reverts commit 0beb6e0dff.
2015-11-16 11:16:43 -06:00
Geoff McLane 0ee77ca7bd Issue #299 - allow '--help' to be the same as '-h' 2015-11-14 15:50:27 +01:00
Geoff McLane fe62fbf8d9 Merge pull request #300 from rdieter/master
allow modified install paths
2015-11-14 15:30:34 +01:00
Geoff McLane c9699d3820 Bump version 5.1.21 for #294, PR #298 2015-11-14 15:24:19 +01:00
Geoff McLane fdaa812c5f Merge pull request #298 from mcepl/dont_mangle_output_filename
Don't mangle the output filename
2015-11-14 15:18:07 +01:00
Rex Dieter d0abe84cb3 support INCLUDE_INSTALL_DIR too 2015-11-13 13:19:10 -06:00
Rex Dieter ea7828fca3 allow modified install paths
and make them consistent between static/shared builds.

Long term, consider using:
https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html

issue #295
2015-11-13 12:33:27 -06:00
Paul Howarth baad0b0064 Don't mangle the output filename
Attached patch works for me, and shouldn't affect any other option
processing.
2015-11-11 11:28:47 +01:00
Shane McCarron 0beb6e0dff Integrated portability changes and fixed version issues
For the attributes content, rel, and rev return the correct
html version value.
2015-11-07 20:42:44 -06:00
Geoff McLane 4ffd0fad63 A fix for test 443576 now with own config 2015-11-07 15:06:50 +01:00
Geoff McLane a5944735df Update 'testbase' to version 5.1.20 2015-11-07 15:02:23 +01:00
Geoff McLane 1e399913ab Merge pull request #293 from htacg/revert-292-master
Revert 22a1922c35
2015-11-07 14:50:59 +01:00
Geoff McLane c68ad42482 Revert 22a1922c35 2015-11-07 14:50:10 +01:00
Geoff McLane 22a1922c35 Merge pull request #292 from halindrome/master
Initial cut at supporting RDFa attributes.
2015-11-07 13:44:30 +01:00
Shane McCarron c572e3e3c8 Initial cut at supporting RDFa attributes. 2015-11-06 12:19:05 -06:00
Geoff McLane e5703803c8 Issue #65 - bump version 5.1.20 for skip-nested/tidySkipNested change 2015-11-05 15:22:21 +01:00
Geoff McLane 800b91e576 Issue #65 - effect name change to skip-nested, and default to on 2015-11-05 15:19:39 +01:00
Geoff McLane 99ae402b02 reset name of EXE 2015-11-05 15:00:22 +01:00
Jim Derry 9f9ca4c774 Version to 5.1.19 2015-11-05 09:38:01 +08:00
Jim Derry 32ce272f75 Fix indent-with-tabs for library use. 2015-11-04 12:44:15 +08:00
Geoff McLane 0706d195ef Oops, a C/C++ little compile problem.
In K&R (pure) C all variables used in a context must be declared before
the first executable phrase. gcc allowed this C/C++ crossover many years
ago.

But compilers, like MSVC, will bark at this problems with a quite weird
difficult to understand, error message!

This small re-arrangement of the code fixes that...
2015-11-04 02:50:00 +01:00
Jim Derry 02909b5fe3 Increment version and date. 2015-11-03 11:37:28 +08:00
Jim Derry 9148f7e710 Merge branch 'tidy_doc_cleanup' 2015-11-03 11:36:34 +08:00
Jim Derry 684621c6f7 Root level README. 2015-11-02 15:53:55 +08:00
Jim Derry 5447e6642b We should Tidy our quickref document. 2015-11-02 15:32:11 +08:00
Jim Derry dec6356a6f Deleted multiple equal id attributes. 2015-11-02 15:31:47 +08:00
Jim Derry d0ac990636 More description beautification. 2015-11-02 12:06:37 +08:00
Jim Derry af97d6a8cd better spacing in man. 2015-11-02 11:31:58 +08:00
Geoff McLane 18af5ecac4 Issue #65 - add some more tests, and adjust testbase accordingly 2015-11-01 20:23:23 +01:00
Jim Derry 807fed4ff6 Documentation improvements. 2015-11-01 19:05:03 +08:00
Jim Derry 678a2a20d1 Merge branch 'master' into tidy_doc_cleanup
Conflicts:
	src/localize.c
2015-11-01 18:36:43 +08:00
Geoff McLane 06b19527a4 Select XHMTL, else HTML 2015-10-31 17:16:52 +01:00
Geoff R. McLane 6208357693 Select XHTML first, else HTML 2015-10-31 17:10:03 +01:00
Geoff R. McLane 0be66cb00b Issue #266 - delete in_676205.html. Use XHTML file 2015-10-31 17:08:53 +01:00
Jim Derry 2613f02dc5 More documentation beautification. 2015-10-31 22:03:33 +08:00
Jim Derry d52e0b353e Update documentation to address #288. 2015-10-31 13:37:34 +01:00
Jim Derry 565d2ec232 Documentation beautification underway. 2015-10-31 18:30:02 +08:00
Jim Derry e0f42bcaba Prototype (undocument) -help-option argument added to console app. 2015-10-31 17:33:43 +08:00
Jim Derry cf3c0293c0 Additional tests with our troublesome option. 2015-10-31 14:45:51 +08:00
Jim Derry 7c7330343e Improved quickref and man. 2015-10-31 14:45:30 +08:00
Jim Derry 30b67f7362 Made labels consisten with quickref. 2015-10-31 14:44:13 +08:00
Jim Derry d712cec4c5 This file shouldn't be tracked. 2015-10-31 11:02:20 +08:00
Jim Derry 9e033cab22 Non cmake build system works again. 2015-10-31 11:00:27 +08:00
Jim Derry e6ceaa8589 Additional documentation for the dependent file. 2015-10-31 10:59:35 +08:00
Jim Derry 354c31e5dd Formatting. 2015-10-31 10:58:51 +08:00
Jim Derry 4ac07978df Fix CMakeLists references to old paths. 2015-10-31 10:58:28 +08:00
Jim Derry 8b95ca5d4f - Consolidated README documents into root-level subdir.
- Removed redundant documentation directory from build.
2015-10-31 09:21:55 +08:00
Jim Derry 8c5fae8c09 - documentation/quickref.xsl
- Includes <p> support
  - Matches the description class name in quickref.include.xsl
  - Styles <br /> to enforce vertical spacing (in the reference table only).
- documentation/style.css
  - Styles <br /> to enforce vertical spacing (in the reference table only).
- documentation/tidy1.xsl.in
  - Includes <p> support.
  - Better manages line breaks with .sp1 instead of .br.
- src/localize.c
  - Legibility to the troublesome `drop-font-tags` description.
2015-10-30 23:58:43 +08:00
Jim Derry 709ac8cb4c Support HTML in descriptions. 2015-10-30 18:17:40 +08:00
Jim Derry 09b0698c56 Typo. 2015-10-30 12:58:11 +08:00
Jim Derry a3138cb142 URL cleanup. 2015-10-30 12:23:20 +08:00
Jim Derry 2d0f971747 Update documentation to address #288. 2015-10-30 10:19:47 +08:00
Geoff McLane 67c86cbe7f Issue #65 - bump to version 5.1.17 for this merge 2015-10-28 16:11:24 +01:00
Geoff McLane f01cfaab9e Issue #65 - Merge issue-65 to master, and drop RC_NUMBER 2015-10-28 16:10:06 +01:00
Geoff McLane ba1f1e00be Issue #286 - Bump to 5.1.16.EXP3 for this fix 2015-10-20 15:06:05 +02:00
Geoff McLane c8751f60e7 Issue #286 - use AddByte for internal transfer 2015-10-20 15:04:18 +02:00
Geoff McLane a94df6c0f9 Issue #285 - Bump to 5.1.15.EXP3 for this fix 2015-10-14 16:57:41 +02:00
Geoff McLane d75c82275d Issue #285 - Add a ResetTags func to erset html5 mode before each document 2015-10-14 16:55:35 +02:00
Geoff McLane 55060018b3 Issue #64 - bump version to .EXP2 for this fix 2015-10-08 17:07:52 +02:00
Geoff McLane adbad0379e Issue #65 - if nonested then no endtag needed to decrement.
This is only if nonested is on, then a <script> tag has not incremented
the nested, so likewise no need to treat an escaped close tag <\/script>
as an end tage to decrement nested.
2015-10-08 17:06:03 +02:00
Geoff McLane 7e69ceb3d1 Issue #281 - only warn BAD_CDATA_CONTENT if inserting an escape. 2015-10-07 16:17:42 +02:00
Geoff McLane 4e3f853e36 Add RC_NUMBER EXP1 for this #65 and #280 fix 2015-10-07 15:13:29 +02:00
Geoff McLane b63c1090c2 option to avoid incrementing nested comtainers.
This is in the GetCDATA function. If the container is script or style and
this option is on, avoid bumping nested.

This addresses issues #65 (1642186) and #280.

All attempts at parsing script data are now abandoned as a bad direction.
2015-10-07 15:11:25 +02:00
Geoff McLane b4efe7464a small enhancement of debug only code 2015-10-05 15:08:20 +02:00
Geoff R. McLane 66b221043a ignore docs zips 2015-10-02 18:57:39 +02:00
Geoff R. McLane d56eaf88f0 convenient build api docs script 2015-10-02 18:55:16 +02:00
Geoff R. McLane 503a093b41 convenient del libs script 2015-10-02 18:54:25 +02:00
Geoff R. McLane 1253b2d9af remove non-existing page 2015-10-02 18:52:22 +02:00
Geoff R. McLane 2c627e5a93 remove 2 doxygen config warnings 2015-10-02 18:51:35 +02:00
Geoff R. McLane d581752042 #279 - add tidy1.xsl to clean up 2015-10-02 14:33:22 +02:00
Geoff R. McLane da0ba45f97 Merge branch 'master' of github.com:htacg/tidy-html5 2015-10-02 14:23:02 +02:00
Geoff R. McLane 9df06179a9 #279 - ignore created 'tidy1.xsl' 2015-10-02 14:22:35 +02:00
Geoff R. McLane d529b4cd83 #279 - remove creation of a new 'documentation' folder 2015-10-02 14:21:15 +02:00
Geoff McLane aecb8afeb4 Update verhist.log to 5.1.14 2015-10-01 15:56:01 +02:00
Geoff McLane 9127aa4fe2 Only publish avail bins 2015-10-01 15:38:48 +02:00
Geoff McLane a35c4b98fe Merge branch 'master' of github.com:htacg/tidy-html5 2015-10-01 14:56:29 +02:00
Geoff McLane dd71a8f6ca Show the tidy version being used 2015-10-01 14:56:06 +02:00
Geoff McLane 67192ba77e Merge pull request #279 from KingDuckZ/master
Use tidy.xsl from documentation/ instead of build/documentation.
2015-09-30 16:28:45 +02:00
King_DuckZ e2ec0e96a0 Use tidy.xsl from documentation/ instead of build/documentation. 2015-09-30 16:06:13 +02:00
Geoff McLane 716eff14cb Merge pull request #278 from KingDuckZ/master
Fix cmake for use as subproject.
2015-09-30 02:25:07 +02:00
King_DuckZ 9be7264e6a Fix cmake for use as subproject. 2015-09-29 23:39:08 +02:00
Geoff McLane fa43957b6d #273 - bump version to 5.1.14 for this fix 2015-09-27 17:38:08 +02:00
Geoff McLane 6c1a2acea2 #273 - avoid xhtml doctype flip/flop 2015-09-27 17:36:57 +02:00
Geoff McLane 7cf9fc2906 #65 - bump version for cdata skip fix 2015-09-25 13:00:06 +02:00
Geoff McLane ce2481c3a9 Merge pull request #274 from CMB/cmbcdata
Issue #65, fix for ignoring cdata.
2015-09-25 12:57:28 +02:00
Christopher Brannon 94b0647c08 Issue #65, fix for ignoring cdata. 2015-09-24 18:13:57 -07:00
Geoff McLane 04ca419080 Issue #64 - Try hard to skip '<![CDATA[ ... ]]>' 2015-09-24 14:21:55 +02:00
Geoff McLane f4113a8643 #65 bump to 5.1.12 for this fix 2015-09-21 12:34:29 +02:00
Geoff McLane 96589c6f57 #65 Skip esc'd esc, and only for script containers 2015-09-21 12:33:53 +02:00
Geoff McLane b2118fa09a Issue #65 - bump to version 5.1.11 for this fix 2015-09-19 14:59:58 +02:00
Geoff McLane eda37c5adb Issue #65 - avoid new quotes if in quotes 2015-09-19 14:58:42 +02:00
Geoff R. McLane 0386e0fa91 massive update of testall.sh 2015-09-18 20:15:12 +02:00
Geoff R. McLane ff101d5dee add t1.sh to do a single input test 2015-09-18 19:35:47 +02:00
Geoff McLane 2c726cfa67 Convenient t1.bat to just do 1 input test case 2015-09-18 17:10:53 +02:00
Geoff R. McLane 55bb3fe0f0 Beef up the cmp.sh script output 2015-09-17 13:42:43 +02:00
Geoff McLane 70d2d5dc66 #65 - Add test 1642186-1 to 'testbase', and add to testcases.txt 2015-09-16 15:08:20 +02:00
Geoff McLane d541405a2a Eventually complete a 2007 fix 2015-09-16 13:17:50 +02:00
Geoff McLane cd8dca2d4c Merge pull request #267 from vielmetti/patch-4
Test case for 1642186: Parser too greedy over <script> blocks
2015-09-15 16:45:17 +02:00
Edward Vielmetti d984edcb21 Config for 1642186 2015-09-15 09:35:15 -04:00
Edward Vielmetti 6b62b1f101 1642186: Parser too greedy over <script> blocks
Originally from http://sourceforge.net/p/tidy/patches/63/ referencing #65
2015-09-15 09:32:55 -04:00
Geoff McLane 202e8307cc Merge pull request #264 from vielmetti/patch-3
Update testhtml5 to use 'tidy' and not 'tidy5'
2015-09-14 20:40:54 +02:00
Geoff McLane 350d104f36 Merge pull request #263 from vielmetti/patch-2
Update testaccessone.sh to reference tidy, not tidy5
2015-09-14 20:39:53 +02:00
Edward Vielmetti e017aad98d Update testhtml5 to use 'tidy' and not 'tidy5'
testhtml5 does not work until you reference the proper executable.
2015-09-14 14:30:09 -04:00
Edward Vielmetti fddb60936d Update testaccessone.sh to reference tidy, not tidy5
Remove 'tidy5' from test script, replace with 'tidy'.
2015-09-14 14:27:26 -04:00
Geoff McLane 732d8d2128 Merge pull request #262 from vielmetti/patch-1
Change "tidy5" to "tidy" in documentation build script
2015-09-14 20:11:15 +02:00
Edward Vielmetti 50255fc37b Convert "tidy5" to "tidy" in build script
With this change, automated documentation builds will work from source.
2015-09-14 14:07:34 -04:00
Geoff McLane 9960f7c6dd Protext agains a NULL node in the Debug only code 2015-09-12 13:06:14 +02:00
Geoff McLane 6ebd527750 adjust name of EXE 2015-09-11 15:47:39 +02:00
Geoff McLane c4bac32f5b Merge pull request #249 from sria91/master
fixed: tidy-html5 debug build fails on VS2015 x64
2015-09-11 11:34:28 +02:00
Srikanth Anantharam be9f1d4203 using _fileno(fout) instead of fout->_file makes it more portable across different MSVC versions 2015-09-11 00:27:17 +05:30
Geoff McLane 1c187f8179 Issue #180 - bump to 5.1.9 for this indenting fix 2015-09-10 15:02:38 +02:00
Geoff McLane c48680cc01 Issue #180 - fix indenting when -omit used 2015-09-10 15:01:48 +02:00
Geoff McLane e38bbe56a5 rename template.org.html to atemplate.org.html 2015-09-10 14:24:10 +02:00
Geoff McLane 2d994a5226 rename template.org.html to atemplate.org.html 2015-09-10 14:23:45 +02:00
Geoff McLane 8ed4b65090 Fix EXE path in alltestc.bat 2015-09-10 14:13:33 +02:00
Geoff McLane 126ebef43c Fix EXE path in acctest.cmd, and change output dir 2015-09-10 13:58:50 +02:00
Geoff McLane cc7b86c945 Some cleanup of the onetest.cmd 2015-09-10 13:37:39 +02:00
Geoff McLane 1bf5a9ad7e Some cleanup of the alltest1.cmd 2015-09-10 13:37:19 +02:00
Geoff McLane 53e6f8f01b Some cleanup of the alltest.cmd 2015-09-10 13:37:08 +02:00
Geoff r. McLane afefe375fd Add 3 diffs seemingly missed 2015-09-09 19:54:44 +02:00
Geoff r. McLane 43cd6a6606 more udpates of 'testbase' 2015-09-09 19:12:56 +02:00
Geoff R. McLane bbc1c2e600 Add report-5.1.8.txt, with details of changes 2015-09-09 14:29:48 +02:00
Geoff R. McLane 5ae0ba4152 Update the 'testbase' to 5.1.8
There were just 21 of 227 message text files changed,
and just 15 of 220 html outputs changed.

After reviewing each diff carefully it seems all changes
were 'better', thus all are deemed acceptable to be
included in this 'testbase' update.

See report-5.1.8.txt for a full list of the changes.
2015-09-09 14:22:11 +02:00
Geoff R. McLane 88a656f029 testone.sh - rename 'tidy5' to 'tidy' 2015-09-09 13:57:14 +02:00
Geoff R. McLane 50e69dbcb1 Some fixes to pub-bins.sh script 2015-09-07 19:28:29 +02:00
Geoff McLane 5ede47ff61 Update the verhist.log 2015-09-06 20:37:48 +02:00
Geoff McLane a94262a7c4 Add CONTRIBUTING.md to README.md 2015-09-04 18:11:42 +02:00
Geoff McLane f1dbc5a884 Add a CONTRIBUTING.md 2015-09-04 18:09:01 +02:00
Geoff McLane 6caf79571a Oops issue refs not automatically expanded in md docs 2015-09-04 16:20:12 +02:00
Geoff McLane dc3fbe28b7 Some tweaks to CODESTYLE.md 2015-09-04 16:16:24 +02:00
Geoff McLane 156cab70b8 Add the new VERSION.md and CODESTYLE.md to README.md 2015-09-04 16:07:17 +02:00
Geoff McLane e4c8c6c489 correct speliling in CODESTYLE.md 2015-09-04 15:52:12 +02:00
Geoff McLane 05cf142e07 Begin some notes on Tidy code style 2015-09-04 15:47:46 +02:00
Geoff McLane 0730502332 Add some notes on libTidy versioning 2015-09-04 15:35:11 +02:00
Geoff McLane 9a74bfde9a Add some important links to README.md 2015-09-04 15:10:20 +02:00
Geoff McLane 87e0e11b49 Merge of issue-228 to master 2015-09-04 15:03:08 +02:00
Geoff r. McLane f0bf30e3cc Merge remote-tracking branch 'upstream/issue-228' 2015-08-30 20:53:36 +02:00
Geoff McLane 2cfae04d19 Merge pull request #242 from b4hand/drop-include-semicolons
Drop unnecessary semicolons from includes in example.
2015-08-27 14:04:42 +02:00
Brandon Forehand 7bc824feec Updated include name. 2015-08-26 09:07:29 -07:00
Brandon Forehand 5cb55761ef Drop unnecessary semicolons from includes in example. 2015-08-25 13:53:54 -07:00
Geoff McLane fd056e353b Bump version to 5.1.7 for #239 addition 2015-08-22 14:04:38 +02:00
Geoff McLane 66e288a8e2 Issue #239 - no warn for apos enitity in html5++ mode 2015-08-22 14:03:02 +02:00
Geoff McLane 5380eb0413 Bump version for #238 2015-08-22 14:00:56 +02:00
Geoff McLane e79137de7f Issue #238 - only except the pre element 2015-08-22 14:00:18 +02:00
Ionel Roiban 91885af638 Merge pull request #236 from skynet/master
Add PHP support section
2015-08-15 19:03:56 -04:00
Geoff McLane 1d67dc940a Merge branch 'Andrew-Dunn-patch-1' into issue-228.
That is reordering windows includes per #234

In general the order of includes should be system <headers>,
then local "headers", except perhaps for the ocassional local
"version" or "config" header...

Resolved conflicts in src/pprint.c by reverting to current master, and in
version.txt by increasing the version.
2015-08-10 18:49:13 +02:00
Geoff McLane 652d4b464b change name of exe in cmd file 2015-08-10 18:10:46 +02:00
Ionel Roiban e2e2cde2ed Add PHP support section 2015-08-09 14:15:36 -04:00
Andrew Dunn dfdffd0cb3 Reordered Windows Includes
Moved the <windows.h> include above the "streamio.h" include to fix compilation with the latest Windows SDK.

<winnt.h> now has the following struct. In particular the `CR` member of this struct conflicts with a define in streamio.h.

    typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY {
        DWORD BeginAddress;
        union {
            DWORD UnwindData;
            struct {
                DWORD Flag : 2;
                DWORD FunctionLength : 11;
                DWORD RegF : 3;
                DWORD RegI : 4;
                DWORD H : 1;
                DWORD CR : 2; // This line causes a compile error because CR is redefined in streamio.h
                DWORD FrameSize : 9;
            } DUMMYSTRUCTNAME;
        } DUMMYUNIONNAME;
    } IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY, * PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;
2015-08-07 17:06:33 +10:00
Geoff McLane 4e7c52607c Bump version to 5.1.4 for table fix. #231 2015-07-31 13:44:46 +02:00
Geoff McLane cbae924a40 Oops, missed setting 'type' for TidyVertSpace.
This was evidenced by an 'assert' failure, that the type was not an 'int'!

And also in the -xml-help output, thus effecting the tidy.1 manual page
for this new feature --vertical-space auto, which produces almost single
line html output.

This 'fix' began in the issue-228 branch - see Issue #231
2015-07-31 13:39:06 +02:00
Geoff McLane 6a24f50466 Bump version to 5.1.3 for issue #232 2015-07-30 14:52:07 +02:00
Geoff McLane 38ef5bfe85 Issue #232 remove CM_HEAD from 'object' tag 2015-07-30 14:50:15 +02:00
Geoff McLane d639181afc Make it clear this is RC_VERSION=D231 running 2015-07-30 14:47:59 +02:00
Geoff McLane 750f31704b Bump version for #158 fixed by PR #229, but re-done here 2015-07-17 19:16:04 +02:00
Geoff McLane ae620a63a2 merge @camoy fix #158 to this branch 2015-07-17 19:00:16 +02:00
Geoff McLane d26cd72084 Add macros to get TidyVertSpace config, and implement 2015-07-15 20:58:00 +02:00
Geoff McLane 154a61543b Expand xml TidyVertSpace text to include tri-state 2015-07-15 20:56:22 +02:00
Geoff McLane 16580e0926 Revert TidyVertSpace to 'no', and make AutoBool option 2015-07-15 20:54:50 +02:00
Geoff McLane 4246c2c462 Issue #230: Need to KEEP this newline char sometimes.
This is a case where the lexer, in GetTokenfromStream, does NOT eat any
trailing newline after a LEX_STARTTAG: case...

So far have identified pre, script, style as NEEDING this user newline
character for later pprint output. Any others?
2015-07-15 19:41:02 +02:00
Geoff McLane 54130dce48 Default to no DLL if WIN32, 64-bit build 2015-07-15 19:29:53 +02:00
Geoff McLane 33494a4aea Bump version for #158 fix by PR #229 2015-07-14 11:27:15 +02:00
Geoff McLane 2c886155d0 Merge pull request #229 from camoy/master
Fix #158 - remove inserted newlines in pre

It seems this does fix this specific issue... thanks...

See #228 for some other comments on this...
2015-07-14 11:24:59 +02:00
Cameron Moy d50391a984 Fix #158 - remove inserted newlines in pre 2015-07-13 16:31:52 -04:00
Geoff McLane cb2543efac Merge branch 'master' of https://github.com/stencila/tidy-html5 into issue-228 2015-07-13 19:11:30 +02:00
Geoff McLane 97c7065177 Remove RC_NUMBER from development master branch 2015-07-13 12:42:19 +02:00
Geoff McLane 7f9df1c746 Issue #226 - bump version on API extension 2015-07-13 12:18:10 +02:00
Geoff McLane 3fccc15ae8 Merge pull request #226 from flok99/master
Added methods for delete-ing nodes and/or attributes. #226
2015-07-13 12:15:52 +02:00
Nokome Bentley 991630e523 Changes default for `vertical-space` to `yes`
Makes this more similar (but not the same) as the previous default
behaviour.
2015-07-13 15:56:15 +12:00
Nokome Bentley b6bcf0408c Applies "smart" new lines to start of script like tags 2015-07-13 15:49:07 +12:00
Nokome Bentley f6979787d1 Adds "smart" line flushing functions.
See in-code comments for more details
2015-07-13 15:40:59 +12:00
Geoff McLane 0d02731679 Add development and release branch meaning 2015-07-13 03:08:24 +02:00
Geoff McLane 2da67a2bbc Bump version to 5.1.0, after 5.0.0 release.
As per the chosen versioning system, this immediately becomes 5.1.0, the
master development stream - hopefully ALWAYS stable - with improvements of
all types...

Should any bug fix be interesting for 5.0.0 release, this change would be
push to the release/5.0.0 branch, making it version 5.0.1... or 5.0.0RC2
if still in the RC stage of release...
2015-07-13 02:17:08 +02:00
Folkert van Heusden 784c7d7f79 Added methods for deleteing nodes and/or attributes.
This is useful when e.g. writing an HTML cleaner.
2015-07-12 18:34:35 +00:00
2022 changed files with 83803 additions and 50034 deletions

12
.drone.yml Normal file
View File

@ -0,0 +1,12 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
repo: egraven/tidy-html5
username: egraven
autotag: true
password:
from_secret: DOCKER_TOKEN

95
.github/workflows/api_test.yml vendored Normal file
View File

@ -0,0 +1,95 @@
################################################################################
# Test LibTidy Public API (via Swift SwLibTidy).
#
# Because SwLibTidy wraps nearly 100% of LibTidy's API, it's a great candidate
# for testing LibTidy via a high-level, easy to write and understand tests.
#
# - This is a Public API test of LibTidy. It does not test the console
# application, is not a unit test, and is not an output regression test.
#
# - Build on multiple operating systems, once the runners are equipped with
# Swift.
#
################################################################################
name: API Test via SwLibTidy
on:
push:
paths:
- 'src/**'
- 'include/**'
- '.github/workflows/**'
pull_request:
paths:
- 'src/**'
- 'include/**'
- '.github/workflows/**'
jobs:
test_library_api:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
############################################################
# Ubuntu latest is a normal build with nothing special that
# really need be done.
# Note: currently disabled because some tests need to be
# refactored to avoid using macOS specific library calls.
############################################################
# - os: ubuntu-latest
# name: Ubuntu
############################################################
# On macOS, we'll build both architectures.
# Note: this is the currently only enabled runner, and I'm
# comfortable with it. This exercises nearly all of
# HTML Tidy's library API, which should be platform
# agnostic.
############################################################
- os: macOS-latest
name: macOS
############################################################
# The standard Windows build is perfectly vanilla, and as
# of now is using MSVC 19.
# Note: currently disabled because some tests need to be
# refactored to avoid using macOS specific library calls,
# but mostly because the Windows runners aren't set up
# yet for running Swift code.
############################################################
# - os: windows-latest
# name: MSVC
steps:
############################################################
# Checkout the Swift testing repository.
############################################################
- name: Checkout SwLibTidy
uses: actions/checkout@v2
with:
repository: htacg/SwLibTidy
############################################################
# Checkout the Tidy repository as Source/CLibTidy
############################################################
- name: Checkout this repository
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/Sources/CLibTidy
############################################################
# Perform swift test
# Note: Github truncates the in-browser log. If you want
# to see everything, look for the Raw Logs button.
############################################################
- name: Swift Test
run: |
swift test

183
.github/workflows/build_and_test.yml vendored Normal file
View File

@ -0,0 +1,183 @@
################################################################################
# Build and Test tidy on the latest versions of all of the major platforms.
#
# - Build on multiple operating systems, and where possible, multiple
# architectures. On Windows, we will also build and test mingw in
# addition to MSVC.
#
# - Report the version number for each binary that is built.
#
# - Run each binary against the regression test suite.
#
################################################################################
name: Build and Test
on:
push:
paths:
- 'src/**'
- 'include/**'
- '.github/workflows/**'
- 'CMakeLists.txt'
branches:
- 'master'
- 'next'
pull_request:
paths:
- 'src/**'
- 'include/**'
- '.github/workflows/**'
- 'CMakeLists.txt'
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
############################################################
# Ubuntu latest is a normal build with nothing special that
# really need be done.
############################################################
- os: ubuntu-latest
name: Standard
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release"
build_command: "cmake --build . --config Release"
vers_command: "./tidy --version"
test_command: "ruby test.rb test"
############################################################
# On macOS, we'll build both architectures.
############################################################
- os: macOS-latest
name: X86_64 & Arm64
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release '-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64'"
build_command: "cmake --build . --config Release"
vers_command: "./tidy --version"
test_command: "ruby test.rb test"
############################################################
# The standard Windows build is perfectly vanilla, and as
# of now is using MSVC 19.
############################################################
- os: windows-latest
name: MSVC
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release"
build_command: "cmake --build . --config Release"
vers_command: "./tidy.exe --version"
test_command: "ruby test.rb test"
############################################################
# We'll also build using MinGW on Windows, because it's
# always nice to support FOSS toolchains. While we could
# do this another way, we'll use the windows-2016 runner
# to distinguish it from the windows-latest runner.
############################################################
- os: windows-2016
name: MinGW
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release -G 'MinGW Makefiles'"
build_command: "cmake --build . --config Release"
vers_command: "./tidy --version"
test_command: "ruby test.rb test"
############################################################
# We'll also build using Cygwin on Windows, because even
# Windows people sometimes dislike Windows. While we could
# do this another way, we'll use the windows-2019 runner to
# distinguish it from the windows-latest runner.
# Note: only the `tidy` target will be built (without the
# man page) for this runner, because xltproc has issues
# loading files in the virtual environment. The man page
# is tested and builds perfectly fine on real installs.
############################################################
- os: windows-2019
name: Cygwin
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release"
build_command: "cmake --build . --target tidy --config Release"
vers_command: "./tidy --version"
test_command: "ruby test.rb test"
steps:
############################################################
# Checkput the repository.
############################################################
- uses: actions/checkout@v2
############################################################
# Install MinGW-w64 if needed for the current runner.
############################################################
- name: Install MinGW-w64
if: ${{matrix.os == 'windows-2016'}}
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
############################################################
# Install Cygwin if needed for the current runner.
############################################################
- name: Install Cygwin
if: ${{matrix.os == 'windows-2019'}}
uses: egor-tensin/setup-cygwin@v3
with:
platform: x64
packages: make gcc-core gcc-g++ cmake
############################################################
# Cmake and Make the project.
############################################################
- name: Build
working-directory: ${{github.workspace}}/build/cmake
run: |
${{matrix.cmake_command}}
${{matrix.build_command}}
############################################################
# Windows MSVC is the only oddball here; why does it
# install the binary into a subfolder, unlike all of the
# other builds? Let's make everything else easier by
# relocating it to the same spot as all the other build
# locations.
############################################################
- name: Move the MSVC exe to someplace sensible
if: ${{matrix.os == 'windows-latest'}}
run: |
move-item -path "${{github.workspace}}/build/cmake/Release/tidy.exe" -destination "${{github.workspace}}/build/cmake/"
############################################################
# Just so that a human can make a quick sanity check.
############################################################
- name: Show Version
working-directory: ${{github.workspace}}/build/cmake
run: |
${{matrix.vers_command}}
############################################################
# Install Ruby for running our regression tests. It's quite
# nice that this package is generic enough to work on all
# of the different runners.
############################################################
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
############################################################
# Ensure that dependencies are met.
############################################################
- name: Bundle Install
working-directory: ${{github.workspace}}/regression_testing
run: |
bundle install
############################################################
# Finally, check for regressions.
############################################################
- name: Run Regression Test
working-directory: ${{github.workspace}}/regression_testing
run: |
${{matrix.test_command}}

View File

@ -0,0 +1,211 @@
################################################################################
# Build Release Packages for Major Platforms
#
# - Builds release packages on multiple operating systems.
#
# - Some packages may have to be supplemented with manually-built releases
# to account for code-signing and/or notarization requirements.
#
################################################################################
name: Publish Linux+Windows
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
required: true
description: "Specify a ref (tag, branch, or sha) to build. If you specify a tag and a release exists, then artifacts will be attached to it."
jobs:
publish_packages:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
############################################################
# Ubuntu latest is a normal build.
# Package building requires rpm in order to generate
# .rpm packages. The runner already includes this by
# default.
############################################################
- os: ubuntu-latest
name: Standard
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release"
build_command: "cmake --build . --config Release --target package"
sha_command: "sha256sum"
stat_command: "stat"
artifacts: "tidy-%s-Linux-64bit.deb tidy-%s-Linux-64bit.rpm"
############################################################
# We won't actually build macOS, because CMake is broken.
# We have a separate build script for macOS that's better
# than CMake's results anyway.
############################################################
#- os: macOS-latest
# name: X86_64 & Arm64
# cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release '-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64'"
# build_command: "cmake --build . --config Release --target package"
# sha_command: "shasum -a 256"
# stat_command: "gstat"
# artifacts: "tidy-%s-macOS-x86_64+arm64.pkg"
############################################################
# The standard Windows build is using MSVC 19 as of now.
# Package building requires nsis and wixtoolset, both of
# which can be installed via choco, which is already
# installed. Note: looks like wixtoolset is already
# installed.
############################################################
- os: windows-latest
name: MSVC
cmake_command: "cmake ../.. -DCMAKE_BUILD_TYPE=Release"
build_command: "cmake --build . --config Release --target package"
sha_command: "sha256sum"
stat_command: "stat"
artifacts: "tidy-%s-win64.exe tidy-%s-win64.msi tidy-%s-win64.zip"
steps:
############################################################
# Install Windows Pre-Requisites
############################################################
- name: Install Windows Requirements
if: ${{matrix.os == 'windows-latest'}}
run: |
choco install nsis -y
############################################################
# Install macOS Pre-Requisites
############################################################
- name: Install macOS Requirements
if: ${{matrix.os == 'macOS-latest'}}
run: |
brew install coreutils
############################################################
# Checkput the repository.
############################################################
- name: Checkout Self
uses: actions/checkout@v2
############################################################
# Get the version number. The output isn't available until
# we exit this step.
############################################################
- name: Get Tidy Version
id: getversion
working-directory: ${{github.workspace}}
shell: bash
run: |
echo "::set-output name=version::$(head -1 version.txt)"
############################################################
# Print the version number, which is now available from
# the previous step.
############################################################
- name: Print Tidy Version
shell: bash
run: |
echo "Tidy version is ${{ steps.getversion.outputs.version }}."
############################################################
# Configure and Build
############################################################
- name: Configure and Build
working-directory: ${{github.workspace}}/build/cmake
shell: bash
run: |
${{matrix.cmake_command}}
${{matrix.build_command}}
############################################################
# Move Files and Make Checksums
############################################################
- name: Move Files and Make Checksums
working-directory: ${{github.workspace}}/build/cmake
shell: bash
run: |
ls -al
mkdir artifacts
array="${{matrix.artifacts}}"
for i in ${array[@]}; do
filename=$(printf "$i\n" ${{ steps.getversion.outputs.version }})
${{matrix.sha_command}} "$filename" > "artifacts/${filename}.sha256"
mv "$filename" "artifacts/"
done
############################################################
# Build Manifest Partials for binaries.html-tidy.org
############################################################
- name: Build Manifest Partials
working-directory: ${{github.workspace}}/build/cmake/artifacts
shell: bash
run: |
ls -al
manifest="../binaries-partial.yml"
touch "${manifest}"
for filename in *.*[^sha256]; do
filesize=$(numfmt --to=si --suffix=B $(wc -c < ${filename}))
modified=$(${{matrix.stat_command}} -c %y "${filename}" | cut -d'.' -f1)
modified="${modified//-//}"
sha256=$(${{matrix.sha_command}} "${filename}" | awk '{print $1}')
echo " - filename: ${filename}" >> "${manifest}"
echo " filesize: ${filesize}" >> "${manifest}"
echo " modified: ${modified}" >> "${manifest}"
echo " describe: ''" >> "${manifest}"
echo " sha256: ${sha256}" >> "${manifest}"
echo "" >> "${manifest}"
done;
cat "${manifest}"
############################################################
# Release the artifacts (existing tag specified)
############################################################
- name: Release to Existing Tag
if: ${{github.event.inputs.tag}}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "${{github.event.inputs.tag}}"
files: "${{github.workspace}}/build/cmake/artifacts/*"
############################################################
# Release the artifacts (done via release)
############################################################
- name: Release via Publish Release
if: ${{!github.event.inputs.tag}}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: "${{github.workspace}}/build/cmake/artifacts/*"
############################################################
# Post the manifest to the run results.
############################################################
- name: Post the Manifest
uses: actions/upload-artifact@v2
with:
name: "partials_for_website-${{matrix.os}}.yml"
path: ${{github.workspace}}/build/cmake/binaries-partial.yml

135
.github/workflows/publish_macos.yml vendored Normal file
View File

@ -0,0 +1,135 @@
################################################################################
# Build a macOS Installer and Disk Image
#
# Although CMake generates macOS installers, it's kind of inflexible and sucks
# a little bit. We can do better, as well as sign and notarize the image as
# well. What's worse is, they're currently broken and don't work at all.
################################################################################
name: Publish macOS
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
required: true
description: "Specify a ref (tag, branch, or sha) to build. If you specify a tag and a release exists, then artifacts will be attached to it."
jobs:
publish_packages:
runs-on: macOS-latest
env:
APPLE_DEVELOPER_ID_INSTALLER: ${{ secrets.APPLE_DEVELOPER_ID_INSTALLER }}
APPLE_DEVELOPER_ID_INSTALLER_PW: ${{ secrets.APPLE_DEVELOPER_ID_INSTALLER_PW }}
APPLE_DEVELOPER_ID_APPLICATION: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION }}
APPLE_DEVELOPER_ID_APPLICATION_PW: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_PW }}
MACOS_PRODUCTSIGN_ID: ${{ secrets.APPLE_DEVELOPER_PRODUCTSIGN_ID }}
MACOS_CODESIGN_ID: ${{ secrets.APPLE_DEVELOPER_CODESIGN_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
steps:
############################################################
# Checkout the Tidy repository as tidy-html5.
# If the user chooses a ref that doesn't exist, we
# fail.
############################################################
- name: Checkout this repository
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/tidy-html5
ref: ${{github.event.inputs.tag}}
############################################################
# Install Required Packages
############################################################
- name: Install Requirements
shell: bash
run: |
brew install ImageMagick
brew install libmagic
brew install create-dmg
brew install coreutils
############################################################
# Checkout the Installer repository as tidy-mac-installer.
############################################################
- name: Checkout tidy-mac-installer
uses: actions/checkout@v2
with:
repository: htacg/tidy-mac-installer
ref: master
path: ${{github.workspace}}/tidy-mac-installer
############################################################
# Configure the environment for code-signing.
# For local environment compatibility, we'll still
# sign in the script; this just gives us the environment
# on the runner.
############################################################
- name: Codesign Setup
working-directory: ${{github.workspace}}/tidy-mac-installer
shell: bash
run: |
security create-keychain -p password1234 build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p password1234 build.keychain
echo "${APPLE_DEVELOPER_ID_INSTALLER}" | base64 --decode > "certificate.p12"
security import "certificate.p12" -k build.keychain -P ${APPLE_DEVELOPER_ID_INSTALLER_PW} -T /usr/bin/codesign -T /usr/bin/productsign
echo "${APPLE_DEVELOPER_ID_APPLICATION}" | base64 --decode > "certificate.p12"
security import "certificate.p12" -k build.keychain -P ${APPLE_DEVELOPER_ID_APPLICATION_PW} -T /usr/bin/codesign -T /usr/bin/productsign
security set-key-partition-list -S apple-tool:,apple:,codesign:,productsign: -s -k password1234 build.keychain
############################################################
# Run the build script.
############################################################
- name: Run the Build Script
id: build_script
working-directory: ${{github.workspace}}/tidy-mac-installer
shell: bash
run: |
./build_installer_image.sh
############################################################
# Release the artifacts (existing tag specified)
############################################################
- name: Release to Existing Tag
if: ${{github.event.inputs.tag}}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "${{github.event.inputs.tag}}"
files: "${{github.workspace}}/tidy-mac-installer/build/artifacts/*"
############################################################
# Release the artifacts (done via release)
############################################################
- name: Release via Publish Release
if: ${{!github.event.inputs.tag}}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: "${{github.workspace}}/tidy-mac-installer/build/artifacts/*"
############################################################
# Post the manifest to the run results.
############################################################
- name: Post the Dmg Artifact
uses: actions/upload-artifact@v2
with:
name: "partials_for_website-macos.yml"
path: "${{github.workspace}}/tidy-mac-installer/build/binaries-partial.yml"

2
.gitignore vendored
View File

@ -6,6 +6,7 @@
*.user
*.suo
*.sdf
/test
/test/testall.log
/test/tmp/
/test/tmp2/
@ -15,3 +16,4 @@ temp*
.DS_Store
.idea
*.old
/regression_testing/cases/*-results/

View File

@ -1,32 +1,65 @@
# CMakeLists.txt - 20150402 - 20150130 - 20140801 - for github htacg/tidy-html5
# Prepare for changing the name to 'tidy'
cmake_minimum_required (VERSION 2.8.8)
##############################################################################
# @file CMakeLists.txt
# Build executables, static and dylibs, packages, build systems, etc., for
# HTML Tidy.
#
# Read this file or use cmake-gui (Windows) or ccmake (everything else) for
# guided build.
#
# @author Geoff McLane [ubuntu@geoffair.info]
# @author HTACG, et al (consult git log)
#
# @copyright
# Copyright (c) 1998-2017 HTACG
# @copyright
# See tidy.h for license.
#
# @date Consult git log.
##############################################################################
cmake_minimum_required (VERSION 2.8.12)
set(LIB_NAME tidy)
set(LIBTIDY_DESCRIPTION "${LIB_NAME} - HTML syntax checker")
set(LIBTIDY_URL "https://www.html-tidy.org")
project (${LIB_NAME})
# ### NOTE: *** Adjust version.txt when required ***
# read 'version' file into a variable (stripping any newlines or spaces)
# 20150609: Revert to supplying BOTH version and date, as we had back in Jan 2015
# NOTE: Both version and date MUST be DOT separated, in two lines.
#################################################
# Setup
#################################################
#------------------------------------------------------------------------
# Release Information
# Release version and date are found in `version.txt`; update *that*
# file when required. It will be read into variable `versionFile`
# (stripping any newlines or spaces). This file must be formatted into
# two lines: the dot-separated MAJOR.MINOR.POINT version, followed by
# the date separated YEAR.MONTH.DAY release date.
#------------------------------------------------------------------------
file(READ version.txt versionFile)
if (NOT versionFile)
message(FATAL_ERROR "Unable to determine libtidy version. version.txt file is missing.")
endif()
string(STRIP "${versionFile}" VERSION_TEXT)
string(REGEX REPLACE "(.*)[\r\n|\n](.*)" "\\1" LIBTIDY_VERSION ${VERSION_TEXT})
string(REGEX REPLACE "(.*)[\r\n|\n](.*)" "\\2" LIBTIDY_DATE ${VERSION_TEXT})
# establish version number
# Establish version number
if (LIBTIDY_VERSION)
string(REPLACE "." ";" VERSION_LIST ${LIBTIDY_VERSION})
list(GET VERSION_LIST 0 TIDY_MAJOR_VERSION)
list(GET VERSION_LIST 1 TIDY_MINOR_VERSION)
list(GET VERSION_LIST 2 TIDY_POINT_VERSION)
set(TIDY_SO_VERSION "${TIDY_MAJOR_VERSION}${TIDY_MINOR_VERSION}")
else ()
message(FATAL_ERROR "*** FAILED to get a VERSION from version.txt!")
endif ()
# establish version date
endif ()
# Establish version date
if (LIBTIDY_DATE)
string(REPLACE "." ";" DATE_LIST ${LIBTIDY_DATE})
list(GET DATE_LIST 0 tidy_YEAR)
@ -36,16 +69,127 @@ else ()
message(FATAL_ERROR "*** FAILED to get a DATE from version.txt!")
endif ()
# BY default, BOTH library types build, Allow turning OFF shared if not neede
set( LIB_TYPE STATIC ) # set default static
option( BUILD_SHARED_LIB "Set OFF to NOT build shared library" ON )
option( BUILD_TAB2SPACE "Set ON to build utility app, tab2space" OFF )
option( BUILD_SAMPLE_CODE "Set ON to build the sample code" OFF )
# Establish SOVERSION. Tidy uses a weird form of semantic versioning,
# wherein even minor versions are stable versions with SONAMEs, and
# odd minor versions are `next` versions that should NOT be released,
# are NOT stable, and should NOT have a valid SONAME.
if (TIDY_SO_VERSION)
math(EXPR NO_SONAME "${TIDY_SO_VERSION} % 2")
if ( NO_SONAME EQUAL 0)
message("-> TIDY_SO_VERSION = ${TIDY_SO_VERSION}. This is an EVEN (stable) release.")
else ()
message("-> TIDY_SO_VERSION = ${TIDY_SO_VERSION}. This is an ODD (development) release.")
endif ()
else ()
message(FATAL_ERROR "*** FAILED to build a TIDY_SO_VERSION!")
endif ()
#------------------------------------------------------------------------
# Library Types and Linking
# By default, *both* static and dynamic library types are built. The
# shared library can be turned off if not needed. The console program
# can be configured for static linking or dynamic linking.
#------------------------------------------------------------------------
set( LIB_TYPE STATIC ) # set default message
option( BUILD_SHARED_LIB "Set OFF to NOT build shared library" ON )
# Issue #326 - Allow linkage choice of console app tidy
option( TIDY_CONSOLE_SHARED "Set ON to link with shared(DLL) lib." OFF )
if (TIDY_CONSOLE_SHARED)
if (NOT BUILD_SHARED_LIB)
message(FATAL_ERROR "Enable shared build for this tidy linkage!")
endif ()
endif ()
#------------------------------------------------------------------------
# Miscellaneous Options
#------------------------------------------------------------------------
option( BUILD_TAB2SPACE "Set ON to build utility app, tab2space" OFF )
option( BUILD_SAMPLE_CODE "Set ON to build the sample code" OFF )
option( TIDY_COMPAT_HEADERS "Set ON to include compatibility headers" OFF )
#------------------------------------------------------------------------
# Man Page
# Allow building with non-default man page directory.
#------------------------------------------------------------------------
if (NOT MAN_INSTALL_DIR)
set(MAN_INSTALL_DIR share/man/man1)
endif ()
option( BUILD_DOCUMENTATION "Set ON to build the documentation" OFF )
#------------------------------------------------------------------------
# Localization
# Allow building without extra language support.
#------------------------------------------------------------------------
option( SUPPORT_LOCALIZATIONS "Set OFF to build without additional languages." ON )
if (SUPPORT_LOCALIZATIONS)
add_definitions ( -DSUPPORT_LOCALIZATIONS=1 )
else ()
add_definitions ( -DSUPPORT_LOCALIZATIONS=0 )
endif ()
#------------------------------------------------------------------------
# Console Application
# Allow building without console support, which mostly prevents
# console strings from existing in the library. Note that this will
# prevent the console application from being built, since it can't be
# linked.
#------------------------------------------------------------------------
option( SUPPORT_CONSOLE_APP "Set OFF to build libraries only without console application support." ON )
if (SUPPORT_CONSOLE_APP)
add_definitions ( -DSUPPORT_CONSOLE_APP=1 )
else ()
add_definitions ( -DSUPPORT_CONSOLE_APP=0 )
endif ()
#------------------------------------------------------------------------
# Diagnostics
# Enable building with logs, some memory diagnostics.
#------------------------------------------------------------------------
option( ENABLE_DEBUG_LOG "Set ON to output debugging messages." OFF )
option( ENABLE_ALLOC_DEBUG "Set ON to output node allocation diagnostics." OFF )
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.")
else ()
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")
endif ()
endif ()
#------------------------------------------------------------------------
# Complier Flags
# Setup other compiler-specific and platform-specific compiler flags.
#------------------------------------------------------------------------
if(CMAKE_COMPILER_IS_GNUCXX)
set( WARNING_FLAGS -Wall )
endif(CMAKE_COMPILER_IS_GNUCXX)
@ -55,20 +199,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif()
if(WIN32 AND MSVC)
# turn off various warnings
set(WARNING_FLAGS "${WARNING_FLAGS} /wd4996")
# C4996: The compiler encountered a deprecated declaration.
# C4090: 'function' : different 'const' qualifiers
# C4244: '=' : conversion from '__int64' to 'uint', possible loss of data
# C4267: 'function' : conversion from 'size_t' to 'uint', possible loss of data
# foreach(warning 4244 4251 4267 4275 4290 4786 4305)
foreach(warning 4090 4244 4267)
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" )
# if (${MSVC_VERSION} EQUAL 1600)
# set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
# endif (${MSVC_VERSION} EQUAL 1600)
# set( NOMINMAX 1 )
# to distinguish between debug and release lib in windows
set( CMAKE_DEBUG_POSTFIX "d" ) # little effect in unix
else()
@ -79,25 +219,113 @@ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}" )
add_definitions ( -DHAVE_CONFIG_H )
add_definitions ( -DSUPPORT_UTF16_ENCODINGS=1 )
add_definitions ( -DSUPPORT_ASIAN_ENCODINGS=1 )
add_definitions ( -DSUPPORT_ACCESSIBILITY_CHECKS=1 )
#------------------------------------------------------------------------
# Static Windows Runtime
# Option to statically link to the Windows runtime. Maybe only
# applies to WIN32/MSVC.
#------------------------------------------------------------------------
if (MSVC)
option( USE_STATIC_RUNTIME "Set ON to change /MD(DLL) to /MT(static)" OFF )
if (USE_STATIC_RUNTIME)
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
message(STATUS "Using /MT STATIC runtime")
else ()
message(STATUS "Using /MD DYNAMIC runtime")
endif ()
endif ()
#------------------------------------------------------------------------
# Macro Values
# These additional macros are set in Tidy's source code. It is *very*
# seldom that you would ever have to change any of these in order to
# achieve a functioning build.
#------------------------------------------------------------------------
add_definitions ( -DLIBTIDY_VERSION="${LIBTIDY_VERSION}" )
add_definitions ( -DRELEASE_DATE="${tidy_YEAR}/${tidy_MONTH}/${tidy_DAY}" )
add_definitions ( -DRC_NUMBER="RC1" )
# Issue #188 - Support user items in platform.h
if (TIDY_CONFIG_FILE)
add_definitions( -DTIDY_CONFIG_FILE="${TIDY_CONFIG_FILE}" )
# Optionally specify an extra version point for pre-release/debug versions.
if (TIDY_RC_NUMBER)
add_definitions ( -DRC_NUMBER="${TIDY_RC_NUMBER}" )
endif ()
if (TIDY_USER_CONFIG_FILE)
add_definitions( -DTIDY_USER_CONFIG_FILE="${TIDY_USER_CONFIG_FILE}" )
# If your OS doesn't have native ISO2022 support, then build with this flag.
if (NO_NATIVE_ISO2022_SUPPORT)
add_definitions ( -DNO_NATIVE_ISO2022_SUPPORT=1 )
endif ()
if (SUPPORT_GETPWNAM)
# If your OS doesn't have library function access(), build with this flag.
if (NO_ACCESS_SUPPORT)
add_definitions ( -DNO_ACCESS_SUPPORT=1 )
endif ()
# Delete me? Not used in Tidy source!
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
# -DTIDY_USER_CONFIG_FILE to override the default paths in tidyplatform.h.
# @note: this section refactored to support #584.
#------------------------------------------------------------------------
if ( UNIX AND SUPPORT_CONSOLE_APP )
option ( ENABLE_CONFIG_FILES "Set to OFF to disable Tidy runtime configuration file support" ON )
# All Unixes support getpwnam(); undef'd in tidyplatform.h if necessary.
add_definitions( -DSUPPORT_GETPWNAM=1 )
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" )
endif ()
# define a default here so we can pass to XSL.
if ( NOT TIDY_USER_CONFIG_FILE )
set( TIDY_USER_CONFIG_FILE "~/.tidyrc" )
endif ()
# do *not* add these unless ENABLE_CONFIG_FILES!
add_definitions( -DTIDY_CONFIG_FILE="${TIDY_CONFIG_FILE}" )
add_definitions( -DTIDY_USER_CONFIG_FILE="${TIDY_USER_CONFIG_FILE}" )
endif ()
#------------------------------------------------------------------------
# Shared Library
# Setup whether or not we will build the shared library.
#------------------------------------------------------------------------
if(BUILD_SHARED_LIB)
set(LIB_TYPE SHARED)
message(STATUS "*** Also building DLL library ${LIB_TYPE}, version ${LIBTIDY_VERSION}, date ${LIBTIDY_DATE}")
@ -105,26 +333,39 @@ else()
message(STATUS "*** Only building static library ${LIB_TYPE}, version ${LIBTIDY_VERSION}, date ${LIBTIDY_DATE}")
endif()
#################################################
# Build
#################################################
#------------------------------------------------------------------------
# File Locations and File Lists
# Setup whether or not we will build the shared library.
#------------------------------------------------------------------------
include_directories ( "${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/src" )
##############################################################################
### tidy library
# file locations
set ( SRCDIR src )
set ( INCDIR include )
# file lists
set ( CFILES
${SRCDIR}/access.c ${SRCDIR}/attrs.c ${SRCDIR}/istack.c
${SRCDIR}/parser.c ${SRCDIR}/tags.c ${SRCDIR}/entities.c
${SRCDIR}/lexer.c ${SRCDIR}/pprint.c ${SRCDIR}/charsets.c ${SRCDIR}/clean.c
${SRCDIR}/localize.c ${SRCDIR}/config.c ${SRCDIR}/alloc.c
${SRCDIR}/attrask.c ${SRCDIR}/attrdict.c ${SRCDIR}/attrget.c
${SRCDIR}/buffio.c ${SRCDIR}/fileio.c ${SRCDIR}/streamio.c
${SRCDIR}/tagask.c ${SRCDIR}/tmbstr.c ${SRCDIR}/utf8.c
${SRCDIR}/tidylib.c ${SRCDIR}/mappedio.c ${SRCDIR}/gdoc.c )
${SRCDIR}/lexer.c ${SRCDIR}/pprint.c ${SRCDIR}/charsets.c
${SRCDIR}/clean.c ${SRCDIR}/message.c ${SRCDIR}/config.c
${SRCDIR}/alloc.c ${SRCDIR}/attrdict.c ${SRCDIR}/buffio.c
${SRCDIR}/fileio.c ${SRCDIR}/streamio.c ${SRCDIR}/tagask.c
${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 )
if (TIDY_COMPAT_HEADERS)
set ( HFILES ${HFILES} ${INCDIR}/buffio.h ${INCDIR}/platform.h )
endif ()
set ( LIBHFILES
${SRCDIR}/access.h ${SRCDIR}/attrs.h ${SRCDIR}/attrdict.h ${SRCDIR}/charsets.h
${SRCDIR}/clean.h ${SRCDIR}/config.h ${SRCDIR}/entities.h
@ -132,64 +373,121 @@ set ( LIBHFILES
${SRCDIR}/mappedio.h ${SRCDIR}/message.h ${SRCDIR}/parser.h
${SRCDIR}/pprint.h ${SRCDIR}/streamio.h ${SRCDIR}/tags.h
${SRCDIR}/tmbstr.h ${SRCDIR}/utf8.h ${SRCDIR}/tidy-int.h
${SRCDIR}/version.h ${SRCDIR}/gdoc.h )
if (MSVC)
list(APPEND CFILES ${SRCDIR}/sprtf.c)
list(APPEND LIBHFILES ${SRCDIR}/sprtf.h)
${SRCDIR}/version.h ${SRCDIR}/gdoc.h ${SRCDIR}/language.h
${SRCDIR}/language_en.h ${SRCDIR}/sprtf.h )
#------------------------------------------------------------------------
# Target Locations
#------------------------------------------------------------------------
if (NOT LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR lib${LIB_SUFFIX})
endif ()
#######################################
# Always build the STATIC library
if (NOT BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR bin)
endif ()
if (NOT INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include)
endif ()
#------------------------------------------------------------------------
# Static Library
# The static library always builds.
#------------------------------------------------------------------------
set(name tidy-static)
add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} )
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME}s
)
list ( APPEND add_LIBS ${name} )
if (WIN32)
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME}_static )
else ()
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME} )
endif ()
if (NOT TIDY_CONSOLE_SHARED) # user wants default static linkage
list ( APPEND add_LIBS ${name} )
endif ()
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 )
########################################
# if user option still on
install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} )
#------------------------------------------------------------------------
# Dynamic Library
# If the user option is still on.
#------------------------------------------------------------------------
if (BUILD_SHARED_LIB)
set(name tidy-share)
if (UNIX AND APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif ()
add_library ( ${name} SHARED ${CFILES} ${HFILES} ${LIBHFILES} )
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME} )
OUTPUT_NAME ${LIB_NAME} )
set_target_properties( ${name} PROPERTIES
VERSION ${LIBTIDY_VERSION}
SOVERSION ${TIDY_MAJOR_VERSION} )
SOVERSION ${TIDY_SO_VERSION}
NO_SONAME ${NO_SONAME} )
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DBUILD_SHARED_LIB" )
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DBUILDING_SHARED_LIB" )
COMPILE_FLAGS "-DBUILD_SHARED_LIB -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 ()
##########################################################
### main executable - linked with STATIC library
set(name ${LIB_NAME})
set ( BINDIR console )
add_executable( ${name} ${BINDIR}/tidy.c )
target_link_libraries( ${name} ${add_LIBS} )
if (MSVC)
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
if(MSVC)
install(FILES $<TARGET_PDB_FILE:tidy-share> DESTINATION ${LIB_INSTALL_DIR} OPTIONAL)
endif()
if (TIDY_CONSOLE_SHARED) # user wants shared/dll linkage
list ( APPEND add_LIBS ${name} )
endif ()
endif ()
install (TARGETS ${name} DESTINATION bin)
#------------------------------------------------------------------------
# Main Executable
# The main executable will be linked with either the static or the
# shared library.
#------------------------------------------------------------------------
if (SUPPORT_CONSOLE_APP)
set(name ${LIB_NAME})
set ( BINDIR console )
add_executable( ${name} ${BINDIR}/tidy.c )
target_link_libraries( ${name} ${add_LIBS} )
if (MSVC)
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
endif ()
if (APPLE)
string(TIMESTAMP CURRENT_YEAR "%Y")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/console/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist
)
target_link_options(${name} PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist)
endif ()
if (NOT TIDY_CONSOLE_SHARED)
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DTIDY_STATIC" )
endif ()
install (TARGETS ${name} DESTINATION bin)
endif ()
#------------------------------------------------------------------------
# Miscellaneous Targets
#------------------------------------------------------------------------
if (BUILD_TAB2SPACE)
set(name tab2space)
add_executable( ${name} ${BINDIR}/tab2space.c )
if (MSVC)
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
endif ()
# no INSTALL of this 'local' tool
# no INSTALL of this 'local' tool - use depreciated
endif ()
if (BUILD_SAMPLE_CODE)
@ -203,136 +501,117 @@ if (BUILD_SAMPLE_CODE)
# no INSTALL of this 'local' sample
endif ()
#==========================================================
#################################################
# Create man pages
#==========================================================
if (UNIX)
#################################################
if (UNIX AND SUPPORT_CONSOLE_APP)
find_program( XSLTPROC_FOUND xsltproc )
if (XSLTPROC_FOUND)
## NOTE: man name must match exe ie currently `${LIB_NAME}.1` not `tidy.1`
## also could use `manpath` command output to determine target install path
set(TIDY_MANFILE ${LIB_NAME}.1)
message(STATUS "*** Generating man ${TIDY_MANFILE} custom commands...")
set(TIDY1XSL ${CMAKE_SOURCE_DIR}/build/documentation/tidy1.xsl)
set(TIDYHELP ${CMAKE_BINARY_DIR}/tidy-help.xml)
set(TIDYCONFIG ${CMAKE_BINARY_DIR}/tidy-config.xml)
add_custom_target(man ALL DEPENDS "${CMAKE_BINARY_DIR}/${LIB_NAME}")
set(TIDY1XSL ${CMAKE_CURRENT_BINARY_DIR}/tidy1.xsl)
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 built EXE to generate xml output
# Run the built EXE to generate xml output .
add_custom_command(
TARGET man
COMMAND ${CMAKE_BINARY_DIR}/${LIB_NAME} -xml-help > ${TIDYHELP}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-help > ${TIDYHELP}
COMMENT "Generate ${TIDYHELP}"
VERBATIM
)
# run built EXE to generate more xml output
# Run the built EXE to generate more xml output.
add_custom_command(
TARGET man
COMMAND ${CMAKE_BINARY_DIR}/${LIB_NAME} -xml-config > ${TIDYCONFIG}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-config > ${TIDYCONFIG}
COMMENT "Generate ${TIDYCONFIG}"
VERBATIM
)
# run xsltproc to generate the install files..
# Run xsltproc to generate the install files.
add_custom_command(
TARGET man
DEPENDS ${TIDYHELP}
COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_BINARY_DIR}/${TIDY_MANFILE}
COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE}
COMMENT "Generate ${TIDY_MANFILE}"
VERBATIM
)
install(FILES ${CMAKE_BINARY_DIR}/${TIDY_MANFILE} DESTINATION ${MAN_INSTALL_DIR})
if (BUILD_DOCUMENTATION)
find_program( DOXYGEN_FOUND doxygen )
if (DOXYGEN_FOUND)
set( WRK_DIR ${CMAKE_SOURCE_DIR}/documentation )
set( EXP_DIR ${WRK_DIR}/examples )
set( OUT_DIR ${WRK_DIR}/temp )
set( DXY_DIR ${WRK_DIR}/temp/tidylib_api )
set( DXY_CFG ${WRK_DIR}/temp_doxygen.cfg )
file( READ ${WRK_DIR}/doxygen.cfg PARAMS )
set( PARAMS "${PARAMS}PROJECT_NUMBER=${LIBTIDY_VERSION}\n" )
set( PARAMS "${PARAMS}GENERATE_TAGFILE=${DXY_DIR}/tidy.tags\n" )
set( PARAMS "${PARAMS}HTML_EXTRA_FILES=${EXP_DIR}/tidy5.help.txt ${EXP_DIR}/tidy5.config.txt\n" )
set( PARAMS "${PARAMS}# eof\n" )
file( WRITE ${DXY_CFG} ${PARAMS} )
file( MAKE_DIRECTORY ${OUT_DIR} )
add_custom_target( documentation ALL )
#=========================================
# Generate files.
#=========================================
add_custom_command(
TARGET documentation
COMMENT "Build Documentation"
VERBATIM
WORKING_DIRECTORY ${WRK_DIR}
COMMAND xsltproc ARGS quickref.xsl ${TIDYCONFIG} > ${OUT_DIR}/quickref.html
COMMAND xsltproc ARGS quickref.include.xsl ${TIDYCONFIG} > ${EXP_DIR}/quickref_include.html # delete later
COMMAND ${CMAKE_BINARY_DIR}/${LIB_NAME} -h > ${EXP_DIR}/tidy5.help.txt # delete later
COMMAND ${CMAKE_BINARY_DIR}/${LIB_NAME} -help-config > ${EXP_DIR}/tidy5.config.txt # delete later
COMMAND cp ARGS ../LICENSE.md ${EXP_DIR} # delete later
)
#=========================================
# Run Doxygen.
#=========================================
add_custom_command(
TARGET documentation
COMMENT "Run Doxygen"
VERBATIM
WORKING_DIRECTORY ${WRK_DIR}
COMMAND cat ${DXY_CFG} | doxygen - > /dev/null
)
#=========================================
# Cleanup.
#=========================================
add_custom_command(
TARGET documentation
COMMENT "Cleanup"
VERBATIM
WORKING_DIRECTORY ${WRK_DIR}
COMMAND rm ${EXP_DIR}/quickref_include.html
COMMAND rm ${EXP_DIR}/tidy5.help.txt
COMMAND rm ${EXP_DIR}/tidy5.config.txt
COMMAND rm ${EXP_DIR}/LICENSE.md
)
install(CODE "MESSAGE(\"Build output can be found in ${OUT_DIR}.\")")
else ()
message(STATUS "*** NOTE: doxygen NOT FOUND! Can NOT generate documentation.")
endif ()
endif ()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE} DESTINATION ${MAN_INSTALL_DIR})
else ()
message(STATUS "*** NOTE: xsltproc NOT FOUND! Can NOT generate man page.")
message(STATUS "*** You need to install xsltproc in your system.")
endif ()
endif ()
##########################################################
### Create MSI,EXE, DMG, DEB/RPM
### TODO: Check each of these builds
##########################################################
#################################################
# Create MSI,EXE, DMG, DEB/RPM
# TODO: Check each of these builds
#################################################
set(BITNESS 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITNESS 64)
endif()
#------------------------------------------------------------------------
# System Runtime Libraries
# Need to ensure that system DLLs get included in a binary
# distribution, but since it can miss some - seems incomplete - make
# optional.
#------------------------------------------------------------------------
option( ADD_SYSTEM_RUNTIMES "Set ON to include system runtime DLLS in distribution" OFF )
if (MSVC AND ADD_SYSTEM_RUNTIMES)
if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
# Visual Studio Express does include redistributable components so
# squelch the warning.
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif ()
set (CMAKE_INSTALL_DEBUG_LIBRARIES OFF)
include (InstallRequiredSystemLibraries)
endif ()
#------------------------------------------------------------------------
# Windows
# MSI - this needs WiX Tooset installed and a path to candle.exe
# EXE - this needs NSIS tools to be in path
# Everything Else
# RPM required to build RPM's, and might not be installed by default.
#------------------------------------------------------------------------
if (WIN32)
# MSI - this needs WiX Tooset installed and a path to candle.exe
# EXE - this needs NSIS tools to be in path
set(CPACK_GENERATOR "NSIS;WIX;ZIP")
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")
set(CPACK_SOURCE_GENERATOR "TGZ")
endif ()
#------------------------------------------------------------------------
# General
#------------------------------------------------------------------------
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")
@ -340,24 +619,83 @@ set(CPACK_PACKAGE_VERSION ${LIBTIDY_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR "${TIDY_MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${TIDY_MINOR_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "${TIDY_POINT_VERSION}")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.html")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.html")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/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_DEPENDS "libc")
set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries")
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_SOURCE_DIR}/test/;${CMAKE_SOURCE_DIR}/build/;${CMAKE_SOURCE_DIR}/.git/")
if (NOT WIN32 AND NOT APPLE)
set( CPACK_PACKAGE_FILE_NAME "${LIB_NAME}-${CPACK_PACKAGE_VERSION}-${BITNESS}bit" )
#------------------------------------------------------------------------
# Windows: it looks like only the LICENSE.txt file is used by Windows,
# for either package type (.exe and .msi).
# Linux: none of the files are shown publicly by default when installing
# from a .deb or .rpm.
# Mac: cannot show HTML; need RTF. CPACK_RESOURCE_FILE_WELCOME isn't
# needed.
#------------------------------------------------------------------------
if (APPLE)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/build/macos/Installer-License.rtf")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/build/macos/Installer-Introduction.rtf")
else ()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html")
endif ()
#------------------------------------------------------------------------
# Debian
#------------------------------------------------------------------------
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${LIBTIDY_URL})
set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries")
set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_SOURCE_DIR}/build" )
#------------------------------------------------------------------------
# RPM config
#------------------------------------------------------------------------
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/man" "/usr/share/man/man1")
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/test/;${CMAKE_CURRENT_SOURCE_DIR}/build/;${CMAKE_CURRENT_SOURCE_DIR}/.git/")
#------------------------------------------------------------------------
# Package name configuration
# The default is LIB_NAME-CPACK_PACKAGE_VERSION-CMAKE_SYSTEM_NAME,
# but we want to include system name for Unixes, and correct the
# system name on Apple targets.
#------------------------------------------------------------------------
if (UNIX AND NOT APPLE)
set(CPACK_PACKAGE_FILE_NAME "${LIB_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${BITNESS}bit")
endif ()
if (APPLE AND NOT IOS)
if (CMAKE_OSX_ARCHITECTURES)
set(CPACK_PACKAGE_FILE_NAME "${LIB_NAME}-${CPACK_PACKAGE_VERSION}-macOS-${CMAKE_OSX_ARCHITECTURES}")
string(REPLACE ";" "+" CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}")
else ()
set(CPACK_PACKAGE_FILE_NAME "${LIB_NAME}-${CPACK_PACKAGE_VERSION}-macOS-${BITNESS}bit")
endif ()
endif ()
if (IOS)
set(CPACK_PACKAGE_FILE_NAME "${LIB_NAME}-${CPACK_PACKAGE_VERSION}-iOS-${BITNESS}bit")
endif ()
#------------------------------------------------------------------------
# Build the Package
#------------------------------------------------------------------------
include(CPack)
#------------------------------------------------------------------------
# pkg-config
#------------------------------------------------------------------------
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 "${LIB_INSTALL_DIR}/pkgconfig"
)
# eof

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM debian:stable-slim AS builder
RUN apt-get update -y && \
apt-get install -y git cmake make build-essential gcc
WORKDIR /build
COPY . .
RUN cd build/cmake
RUN cmake /build -DCMAKE_BUILD_TYPE=Release
RUN make
RUN make install
FROM debian:stable-slim AS runtime
COPY --from=builder /usr/local/bin/tidy /usr/local/bin/tidy
ENTRYPOINT [ "/usr/local/bin/tidy" ]

View File

@ -1,45 +0,0 @@
Copyright (c) 1998-2015 World Wide Web Consortium
(Massachusetts Institute of Technology, European Research
Consortium for Informatics and Mathematics, Keio University).
All Rights Reserved.
Contributing Author(s):
Dave Raggett <dsr@w3.org>
The contributing author(s) would like to thank all those who
helped with testing, bug fixes and suggestions for improvements.
This wouldn't have been possible without your help.
COPYRIGHT NOTICE:
This software and documentation is provided "as is," and
the copyright holders and contributing author(s) make no
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.
The copyright holders and contributing author(s) will not be held
liable for any direct, indirect, special or consequential damages
arising out of any use of the software or documentation, even if
advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute
this source code, or portions hereof, documentation and executables,
for any purpose, without fee, subject to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must
not be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The copyright holders and contributing author(s) specifically
permit, without fee, and encourage the use of this source code
as a component for supporting the Hypertext Markup Language in
commercial products. If you use this source code in a product,
acknowledgment is not required but would be appreciated.

View File

@ -1,124 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
HTML Tidy with HTML5 support
</title>
<style>
h1 {
background-color: #6495ed;
}
code {
background-color: #e0ffff;
}
div {
background-color: #b0c4de;
}
</style>
</head>
<body>
<h1>
HTML Tidy with HTML5 support
</h1>
<h2>
Prerequisites
</h2>
<ol>
<li>
<p>
git - http://git-scm.com/book/en/v2/Getting-Started-Installing-Git
</p>
</li>
<li>
<p>
cmake - http://www.cmake.org/download/
</p>
</li>
<li>
<p>
appropriate build tools for the platform
</p>
</li>
</ol>
<p>
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 the command line use.
</p>
<p>
Also the actual build tools vary for each platform. But that is one of the great features of
cmake, it can generate variuous 'native' build files. Running cmake without any parameters will
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.
</p>
<p>
In windows cmake offers various versions of MSVC. Again below only the command line use of MSVC
is shown, but the tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building
done in there.
</p>
<h2>
Build the tidy library and command line tool
</h2>
<ol>
<li>
<p>
<code>cd build/cmake</code>
</p>
</li>
<li>
<p>
<code>cmake ../.. [-DCMAKE_INSTALL_PREFIX=/path/for/install]</code>
</p>
</li>
<li>
<p>
Windows: <code>cmake --build . --config Release</code>
<br>
Unix/OS X: <code>make</code>
</p>
</li>
<li>
<p>
Install, if desired:
<br>
Windows: <code>cmake --build . --config Release --target INSTALL</code>
<br>
Unix/OS X: <code>[sudo] make install</code>
</p>
</li>
</ol>
<p>
By default cmake sets the install path to /usr/local in unix. If you wanted the binary in say
/usr/bin instead, then in 2. above use -DCMAKE<em>INSTALL</em>PREFIX=/usr
</p>
<p>
In windows the default install is to C:\Program Files\tidy5, or C:/Program Files (x86)/tidy5,
which is not very useful. After the build the tidy[n].exe is in the Release directory, and can
be copied to any directory in your PATH environment variable, for global use.
</p>
<p>
If you need the tidy library built as a 'shared' (DLL) library, then in 2. add the command
-DBUILD<em>SHARED</em>LIB:BOOL=ON. This option is OFF by default, so the static library is
built and linked with the command line tool for convenience.
</p>
<h2>
History
</h2>
<p>
This repository should be considered canonical for HTML Tidy as of 2015-January-15.
</p>
<ul>
<li>
<p>
This repository originally transferred from <a href=
"http://w3c.github.com/tidy-html5/">w3c.github.com/tidy-html5</a>.
</p>
</li>
<li>
<p>
First moved to Github from <a href="http://tidy.sourceforge.net">tidy.sourceforge.net</a>.
</p>
</li>
</ul>
</body>
</html>

120
README.md
View File

@ -1,56 +1,104 @@
# HTML Tidy with HTML5 support
[![Build Status](https://drone.data.coop/api/badges/emelie/tidy-html5/status.svg?ref=refs/heads/next)](https://drone.data.coop/emelie/tidy-html5)
## Prerequisites
## Forked from [https://github.com/htacg/tidy-html5](https://github.com/htacg/tidy-html5)
1. git - http://git-scm.com/book/en/v2/Getting-Started-Installing-Git
# HTACG HTML Tidy
All other READMEs and related materials can be found in [README/][100]. Although all of our materials should be linked in this README, be sure to check this directory for documents weve not yet added to this document.
## Building HTML Tidy
- For build instructions please see [README/BUILD.md][115].
2. cmake - http://www.cmake.org/download/
## Branches and Versions
Learn about which branches are available, which branch you should use, and how HTML Tidys versioning scheme works.
- Learn about version numbering in [README/VERSION.md][160].
- Learn about our repository branches in [README/BRANCHES.md][110].
3. appropriate build tools for the platform
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 the command line use.
## Contributing and Development Guides
Also the actual build tools vary for each platform. But that is one of the great features of cmake, it can generate variuous 'native' build files. Running cmake without any parameters will 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.
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.
In windows cmake offers various versions of MSVC. Again below only the command line use of MSVC is shown, but the tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building done in there.
### General Contribution Guidelines
These are some general guidelines that will help you help us when it comes to making your own contributions to HTML Tidy.
- Learn about our contributing guidelines in [README/CONTRIBUTING.md][125].
- Understand HTML Tidys source code style in [README/CODESTYLE.md][120].
### Adding Features Guides
When youre ready to add a great new feature, these write-ups may be useful.
- Learn how to add new element attributes to HTML Tidy by reading [README/ATTRIBUTES.md][105].
- Discover how to add new tags to Tidy in [README/TAGS.md][130].
- If you want to add new messages to Tidy, read [README/MESSAGE.md][150].
- Configuration options can be added according to [README/OPTIONS.md][155].
- Pull Requests must pass all existing regression tests, or you must change existing regression test expectations with a good explanation. New features require that you add new regression tests. See [README/TESTING.md][165] for more details.
### Language Localization Guides
Tidy supports localization, and welcomes translations into various languages. Please read up on how to localize HTML Tidy.
- The general README for localizing can be found in [README/LOCALIZE.md][140].
- And [localize/README.md][145] contains specific instructions for localizing.
## Build the tidy library and command line tool
## Other Important Links
1. `cd build/cmake`
- site: [https://www.html-tidy.org/][4]
- source: [https://github.com/htacg/tidy-html5][5]
- binaries: [https://binaries.html-tidy.org][6]
- bugs: [https://github.com/htacg/tidy-html5/issues][7]
- list: [https://lists.w3.org/Archives/Public/html-tidy/][8]
- api and quickref: [https://api.html-tidy.org/][9]
- Wikidata: [https://www.wikidata.org/wiki/Q1566084][10]
2. `cmake ../.. [-DCMAKE_INSTALL_PREFIX=/path/for/install]`
[4]: https://www.html-tidy.org/
[5]: https://github.com/htacg/tidy-html5
[6]: https://binaries.html-tidy.org
[7]: https://github.com/htacg/tidy-html5/issues
[8]: https://lists.w3.org/Archives/Public/html-tidy/
[9]: https://api.html-tidy.org/
[10]: https://www.wikidata.org/wiki/Q1566084
3. Windows: `cmake --build . --config Release`
Unix/OS X: `make`
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 in unix. If you wanted the binary in say /usr/bin instead, then in 2. above use -DCMAKE_INSTALL_PREFIX=/usr
Also, in unix if you want to build the release library without any debug `assert` in the code then add `-DCMAKE_BUILD_TYPE=Release` in step 2. This adds a `-DNDEBUG` macro to the compile switches. This is normally added in windows build for the `Release` config.
In windows the default install is to C:\Program Files\tidy5, or C:/Program Files (x86)/tidy5, which is not very useful. After the build the tidy[n].exe is in the Release directory, and can be copied to any directory in your PATH environment variable, for global use.
If you do **not** need the tidy library built as a 'shared' (DLL) library, then in 2. add the command -DBUILD_SHARED_LIB:BOOL=OFF. This option is ON by default. The static library is always built and linked with the command line tool for convenience in windows, and so the binary can be run as part of the man page build without the shared library being installed in unix.
## Prebuilt Binaries
An attempt is being made to publish pre-built binaries to http://www.htacg.org/binaries - This is still a work in progress, but getting there..
## History
This repository should be considered canonical for HTML Tidy as of 2015-January-15.
This repository should be considered canonical for HTML Tidy starting from 2015-January-15.
- This repository originally transferred from [w3c.github.com/tidy-html5][1].
- This repository originally transferred from [w3c.github.com/tidy-html5][20], then redirected to the current site, but now dead.
- First moved to Github from [tidy.sourceforge.net][2].
- 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...
[20]: https://w3c.github.com/tidy-html5/
[21]: http://tidy.sourceforge.net
[1]: http://w3c.github.com/tidy-html5/
## License
[2]: http://tidy.sourceforge.net
HTML Tidy and LibTidy are free and open source software with a permissive license.
; eof
- You can read the complete license in [README/LICENSE.md][135].
[100]: README/
[105]: README/ATTRIBUTES.md
[110]: README/BRANCHES.md
[115]: README/BUILD.md
[120]: README/CODESTYLE.md
[125]: README/CONTRIBUTING.md
[130]: README/TAGS.md
[135]: README/LICENSE.md
[140]: README/LOCALIZE.md
[145]: localize/README.md
[150]: README/MESSAGE.md
[155]: README/OPTIONS.md
[160]: README/VERSION.md
[165]: README/TESTING.md

104
README/API_AND_NAMESPACE.md Normal file
View File

@ -0,0 +1,104 @@
# The `LibTidy` API and Namespacing
## Introduction
If you're just getting started working with `LibTidy`, some of the design choices may seem overwhelming if you're not a seasoned C veteran. Hopefully this article will give a decent overview, encouraging you to explore and contribute to the `LibTidy` code.
This article will discuss briefly:
- How `LibTidy` achieves namespacing in C
- Explanations for some of the bizzarre, do-nothing macros.
- Opaque types
- How to add new functions to the `LibTidy` API.
# Namespacing
The C language does not support built in namespacing, but it is subject to namespace collision, especially when a library is statically linked. `LibTidy` tries to get around this by making a compromise between human-readable names and making the names random enough to avoid a collision.
As you browse Tidy's code, you'll notice many uses of a macro function `TY_()` applied to the function names of non-static functions. The preprocessor thus resolves all of these function names to `prvTidyFunction`, thus ensuring a clear namespace and avoiding the possibility of collisions (unless some other library has thoughtlessly borrowed our prefix for the same). For example, `TY_(getNextOptionPick)` will resolve to `prvTidygetNextOptionPick` when compiled.
Of course, `static` functions are immune to the issue of namespace pollution, so in general you will really only use this technique for functions that must be accessible from outside of your new file, such as functions that you want to expose to the API.
# Macros for documentation
`TIDY_EXPORT` and `TIDY_CALL` are defined to be `NULL`, i.e., when compiled they resolve to nothing. These are used exclusively for documenting functions that are part of the API defined in `tidy.h` and the implementation in `tidylib.c`. For example, in `tidy.h`:
~~~
TIDY_EXPORT TidyIterator TIDY_CALL getWindowsLanguageList();
~~~
The `TIDY_EXPORT` call clearly indicates that this function prototype is meant to be exported from the API, and `TIDY_CALL` clearly indicates that the function is called from within `LibTidy`.
Although this makes things obvious from the documentation perspective, the truth is a little murkier. In some environments one might define `TIDY_EXPORT` and `TIDY_CALL` differently in order to control compiler behavior, especially in environments that have special requirements for dynamic libraries. In general, though, you shouldn't have to worry about this.
The preferred use of pointer operators when documenting with macros is this:
~~~
const tidyLocaleMapItem* TIDY_CALL getNextWindowsLanguage( TidyIterator* iter )
~~~
…instead of this:
~~~
const tidyLocaleMapItem TIDY_CALL *getNextWindowsLanguage( TidyIterator* iter )
~~~
# External types are opaque
In several spots the source code indicates that a particular structure is "opaque." This simply means that API users cannot see inside of them, and they have to depend on accessor functions to gain access to the sweet fruit that is within. This is a design choice that makes `LibTidy` highly portable and makes it accessible to multitudes of other languages that can communicate with a C API.
Take `tidyDoc` for example, as it's the most fundamental datatype within `LibTidy`. As an API user, you can have a reference to a `tidyDoc`, and you're going to pass it around a lot to accessor functions (such as `tidyCleanAndRepair`), and you know that it contains lots of good stuff, but you're not allowed to peek inside of it unless an accessor function is provided. Think of it as a token that you pass around, and nothing more.
Internally, the type is cast to a native C structure of type `tidyDocImpl`, and so if you decide to become a Tidy developer, you have the choice to access the item fully.
If you extend Tidy's API, it's important to respect this design choice, even if only writing functionality for the console application (which is, of course, simply an implementor of `LibTidy`).
# How to add new functions to `LibTidy`
All of the information above is useful for anyone who wants to browse Tidy's source code, or use the API, or understand Tidy better, but it all comes together nicely when you want to extend the API. This quick lesson will show you how to do so, using `tidyLocalizedString()` as an example.
## Behind the scenes
The first thing we need to do is have the internal version of the function that we want to add. Tidy has a module that handles localization: `language.h/c`. In the header is where we define the interface to LibTidy, which should be namespaced according to the discussion above. We can declare:
~~~
ctmbstr TY_(tidyLocalizedString)( uint messageType );
~~~
…and of course implement it in the `.c` file.
Now you have a decision to make: if you plan to use this function internally, you're going to have to import the header into other modules that require the function. This can lead to painful compile-time consequences. However since we want to expose this particular function to the API, it will be visible within `TidyLib`, so we can use the public API internally, too.
## The API
Once implemented, we want a pretty, public-facing name for our `tidyLocalizedString()` function, which appropriately is `tidyLocalizedString()`. Add the declaration to `tidy.h`:
~~~
TIDY_EXPORT ctmbstr TIDY_CALL tidyLocalizedString( uint messageType );
~~~
…and now the publicly exposed interface knows that your function exists. All that's left to do is add the `language.h` header to `tidylib.c`, and then implement it there:
~~~
ctmbstr TIDY_CALL tidyLocalizedString( uint messageType )
{
return TY_(tidyLocalizedString)( messageType );
}
~~~
Congratulations, you can now expose new functionality to the API.
## API functions for opaque types
For a more complicated example that demonstrates how to use opaque types (and also the `TidyIterator` type) have a look at the implementation of `getWindowsLanguageList()`, and its partners `*getNextWindowsLanguage()`, `TidyLangWindowsName()`, and `TidyLangPosixName()`. These demonstrate how to:
- implement iteration for structures with multiple records.
- write a function in `tidylib.c` that converts between the exposed, opaque type and the internal, implementation type.
- further reinforce how functionality is added to the API.

26
README/ATTRIBUTES.md Normal file
View File

@ -0,0 +1,26 @@
# Tidy Element Attributes
This is about adding a **new** HTML attribute to one or more HTML tags, i.e., a new attribute such as `attribute=value`.
Tidys large number of attributes are supported via number of files:
- `tidyenum.h` is where you first define a new attribute in order to give it an internal value.
- `attrs.c` is where you give a unique **string** name to the attribute, as well as a **function** to verify the **value**.
- `attrdict.c` further refines the definition of your attribute, specifying which version(s) of HTML support this attribute.
- `tags.c`, finally, determines which tags support the attribute, in the `tag_defs[]` table.
So, to add a new `attribute=value`, on one or more existing tags, consists of the following simple steps -
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...
Now, one could argue that this is not the **best** way to verify every attribute and value, for every tag, but that is a moot point - that is how Tidy does it!
; eof 20170205

28
README/BRANCHES.md Normal file
View File

@ -0,0 +1,28 @@
# HTML Tidy Branches
## About Branches
Starting with **HTML Tidy** 5.4.0, HTACG will adopt a new branch management strategy utilizing **master** as the _release branch_, and **next** as the active development branch.
As described thoroughly in our [VERSION.md](VERSION.md) document, this means that **master** will always consist of an even-numbered minor version, and activity will remain relatively quiet unless we backport a critical bug fix from **next**.
The **next** branch, then will host the majority of our development activity, and any contributions and PRs should be against this branch. This means that **next** will always consist of an odd minor version number.
## About Versioning
You can read the specifics about version numbers in our [VERSION.md](VERSION.md) document.
## FAQs
### Which version or branch should I choose?
As described above, the branch is very strongly correlated with the version. If you require a stable API and relatively stable output and dont require the features and enhancements of an odd-numbered **next** version, then you should stick to **master**, even-numbered versions.
On the other hand if you are primarily a console application user, then the API isnt likely as important to you, and you probably want the latest and greatest. If this describes you, you probably want to at least try out **next**.
If you are developing for Tidy, then you _definitely_ want to stick to **next**, even for bug fixes meant for **master**. If its a critical enough bug fix, then one of our friendly team will back-port the fix to **master**.

91
README/BUILD.md Normal file
View File

@ -0,0 +1,91 @@
# HTACG HTML Tidy
## Prerequisites
1. git - [https://git-scm.com/book/en/v2/Getting-Started-Installing-Git][1]
2. cmake - [https://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.
In Windows CMake offers various versions for MSVC. Again below only the command line use of MSVC is shown, but the tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building done in there.
## Build the tidy library and command line tool
### macOS/Linux/Unix
~~~
cd build/cmake
cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]
make
[sudo] make install
~~~
### macOS (multi-architecture)
~~~
cd build/cmake
cmake ../.. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"
make
[sudo] make install
~~~
### Windows
~~~
cd build/cmake
cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]
cmake --build . --config Release
cmake --build . --config Release --target INSTALL
~~~
### Build options
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 the second step, use `-DCMAKE_INSTALL_PREFIX=/usr`.
Also, in Unix if you want to build the release library without any debug `assert` in the code then add `-DCMAKE_BUILD_TYPE=Release` in the second step. This adds a `-DNDEBUG` macro to the compile switches. This is normally added in windows build for the `Release` config.
In Windows the default install is to `C:\Program Files\tidy`, or `C:/Program Files (x86)/tidy`, which is not very useful. After the build the `tidy.exe` is in the `Release` directory, and can be copied to any directory in your `PATH` environment variable for global use.
On macOS, you can build for both Intel and Apple Silicon by adding "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" in the second step.
If you do **not** need the tidy library built as a 'shared' (DLL) library, then in the second step add the command `-DBUILD_SHARED_LIB:BOOL=OFF`. This option is **ON** by default. The static library is always built and linked with the command line tool for convenience in Windows, and so the binary can be run as part of the man page build without the shared library being installed in unix.
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
Before PHP 7.1, 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.
That is - prior to configuring PHP run this in the PHP source directory:
~~~
sed -i 's/buffio.h/tidybuffio.h/' ext/tidy/*.c
~~~
And then continue with (just an example here, use your own PHP config options):
~~~
./configure --with-tidy=/usr/local
make
make test
make install
~~~
[1]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
[2]: https://cmake.org/download/
[3]: http://xmlsoft.org/XSLT/xsltproc2.html

246
README/CHANGELOG.md Normal file
View File

@ -0,0 +1,246 @@
# Changelog
## [5.8.0](https://github.com/htacg/tidy-html5/tree/5.8.0) (2021-07-10)
[Full Changelog](https://github.com/htacg/tidy-html5/compare/5.6.0...5.8.0)
**Fixed bugs:**
- Details open, Value added to Attribute [\#925](https://github.com/htacg/tidy-html5/issues/925)
- Fix handling of percent symbols in CheckLength validation routine [\#910](https://github.com/htacg/tidy-html5/issues/910)
- What is the true purpose and use case of the --bare option? [\#896](https://github.com/htacg/tidy-html5/issues/896)
- Warning about missing \</summary\> [\#895](https://github.com/htacg/tidy-html5/issues/895)
- DecodeMacRoman\(\) is missing an upper bounds check before indexing into Mac2Unicode array [\#891](https://github.com/htacg/tidy-html5/issues/891)
- Can't disable wrap [\#858](https://github.com/htacg/tidy-html5/issues/858)
- Recursion limit exceeded [\#850](https://github.com/htacg/tidy-html5/issues/850)
- template tag should be allowed in head [\#836](https://github.com/htacg/tidy-html5/issues/836)
- tag\_defs + AdjustTags\(\) and ResetTags\(\) during parsing is not thread-safe \(tags.c\) [\#816](https://github.com/htacg/tidy-html5/issues/816)
- Unexpected parsing with uppercase DOCTYPE [\#815](https://github.com/htacg/tidy-html5/issues/815)
- bugfix for messageobj.c for windows vc++ [\#800](https://github.com/htacg/tidy-html5/issues/800)
- Tidy 5.7.20 GetSurrogatePair can use uninitialised value processing malformed entity refs [\#798](https://github.com/htacg/tidy-html5/issues/798)
- regression tests fail if /etc/tidy.conf or ~/.tidyrc exists [\#778](https://github.com/htacg/tidy-html5/issues/778)
- AddByte allocAmt overflows for large input files [\#761](https://github.com/htacg/tidy-html5/issues/761)
- --strict-tags-attributes no doesn't ignore \<td align\> [\#729](https://github.com/htacg/tidy-html5/issues/729)
- "Too many title elements in \<title\>" should say "Too many title elements in \<head\>" [\#692](https://github.com/htacg/tidy-html5/issues/692)
- Tidy 5.6.0 on Mac says Not a file when file is not writeable [\#681](https://github.com/htacg/tidy-html5/issues/681)
- Tidy fails if html contains a section \<!\[endif\]—\> [\#487](https://github.com/htacg/tidy-html5/issues/487)
- "Malformed" Word 2000 sequence may cause Tidy to skip document content [\#462](https://github.com/htacg/tidy-html5/issues/462)
- Change open tag to Boolean [\#932](https://github.com/htacg/tidy-html5/pull/932) (@arrmo)
- Is \#729 - Show 'warnings' in all td cases [\#928](https://github.com/htacg/tidy-html5/pull/928) (@geoffmcl)
- Issue \#692 - too many titles [\#927](https://github.com/htacg/tidy-html5/pull/927) (@geoffmcl)
- Is. \#681 - read-only files, and dirs [\#926](https://github.com/htacg/tidy-html5/pull/926) (@geoffmcl)
- Free attributes before return NULL [\#899](https://github.com/htacg/tidy-html5/pull/899) (@ltx2018)
- Is. \#896 - make 'bear' docs match code [\#898](https://github.com/htacg/tidy-html5/pull/898) (@geoffmcl)
- Correction for issue-895 [\#897](https://github.com/htacg/tidy-html5/pull/897) (@arrmo)
- fix memleak in GetTokenFromStream [\#884](https://github.com/htacg/tidy-html5/pull/884) (@ltx2018)
- Protect against NULL in PruneSection. [\#853](https://github.com/htacg/tidy-html5/pull/853) (@esclim)
- Is \#815 - Use case-insensitive test 'html' [\#832](https://github.com/htacg/tidy-html5/pull/832) (@geoffmcl)
- Is. \#761 - just deal with the 'uint' wrap [\#830](https://github.com/htacg/tidy-html5/pull/830) (@geoffmcl)
- Tidy 5.7.20 crashes if allocator replaced [\#797](https://github.com/htacg/tidy-html5/issues/797)
- --mute should suppress non-zero exit code [\#794](https://github.com/htacg/tidy-html5/issues/794)
- Seems tidy.c has sprung a leak [\#791](https://github.com/htacg/tidy-html5/issues/791)
- Cannot handle read-only html files \(possibly regression?\) [\#789](https://github.com/htacg/tidy-html5/issues/789)
- setlocale\( LC\_ALL, ""\) changes the locale for the entire application [\#770](https://github.com/htacg/tidy-html5/issues/770)
- mute in ~/.tidyrc runs fine but triggers exit\(1\) [\#752](https://github.com/htacg/tidy-html5/issues/752)
- Duplicate IDs are not detected if the ID has an uppercase letter [\#726](https://github.com/htacg/tidy-html5/issues/726)
- Tidy gets confused with a \<span\> around a block element [\#709](https://github.com/htacg/tidy-html5/issues/709)
- Tidy seems to get confused by HTML strings in JavaScript blocks. [\#700](https://github.com/htacg/tidy-html5/issues/700)
- tidy indent+wrap breaks \<pre\> formatting [\#697](https://github.com/htacg/tidy-html5/issues/697)
- -export-config creates invalid configuration file [\#679](https://github.com/htacg/tidy-html5/issues/679)
- Segmentation Fault [\#656](https://github.com/htacg/tidy-html5/issues/656)
- Maybe a problem with some vsnprintf implementations? [\#655](https://github.com/htacg/tidy-html5/issues/655)
- Why is libtidy complaining \<data\> isnt approved by W3C? [\#649](https://github.com/htacg/tidy-html5/issues/649)
- Is. \#791 - free some allocations [\#809](https://github.com/htacg/tidy-html5/pull/809) (@geoffmcl)
- Issue 726 upper case anchors [\#731](https://github.com/htacg/tidy-html5/pull/731) (@geoffmcl)
- Is \#673 - Revert 350f7b4 and 86e62db AdjustConfig logic [\#705](https://github.com/htacg/tidy-html5/pull/705) (@geoffmcl)
- Issue \#655 - Fix unsafe use of output buffer as input param [\#662](https://github.com/htacg/tidy-html5/pull/662) (@geoffmcl)
- Issue \#656 - protect against NULL node set in loop [\#661](https://github.com/htacg/tidy-html5/pull/661) (@geoffmcl)
**Closed issues:**
- No NPM? [\#960](https://github.com/htacg/tidy-html5/issues/960)
- Where can I find the list of known tags? [\#958](https://github.com/htacg/tidy-html5/issues/958)
- fix non-standard static library name [\#952](https://github.com/htacg/tidy-html5/issues/952)
- Lot of config options; but where are the defaults specified [\#948](https://github.com/htacg/tidy-html5/issues/948)
- Any Windows Binaries for 5.7.28, just like 5.6? [\#947](https://github.com/htacg/tidy-html5/issues/947)
- Setup continuous integration and testing [\#944](https://github.com/htacg/tidy-html5/issues/944)
- Linux binaries for latest releases [\#939](https://github.com/htacg/tidy-html5/issues/939)
- Outdated warnings [\#938](https://github.com/htacg/tidy-html5/issues/938)
- Umlauts/special characters not converted to correct html entities [\#936](https://github.com/htacg/tidy-html5/issues/936)
- tidy hanging [\#935](https://github.com/htacg/tidy-html5/issues/935)
- Tidy catches repeated attributes, but misses identical ids [\#924](https://github.com/htacg/tidy-html5/issues/924)
- drop-empty-elements is not removing empty Table elements [\#923](https://github.com/htacg/tidy-html5/issues/923)
- Tag "main" is shown as error [\#922](https://github.com/htacg/tidy-html5/issues/922)
- Unexpected parsing a tag in table [\#919](https://github.com/htacg/tidy-html5/issues/919)
- beginner on windows -- tidy reports: document: "a0.htm" is not a file! -- But it is [\#918](https://github.com/htacg/tidy-html5/issues/918)
- tidy says this misplaced \</dl\> is OK [\#917](https://github.com/htacg/tidy-html5/issues/917)
- Tidy can't deal with \<中文\> XML tags [\#913](https://github.com/htacg/tidy-html5/issues/913)
- Support extended color names in HTML 5 [\#908](https://github.com/htacg/tidy-html5/issues/908)
- Unknown type uint trying to use the shared lib. [\#906](https://github.com/htacg/tidy-html5/issues/906)
- \</select\> ending tag missing [\#904](https://github.com/htacg/tidy-html5/issues/904)
- SVG attributes flagged as proprietary [\#903](https://github.com/htacg/tidy-html5/issues/903)
- tidy-mark option is not working [\#901](https://github.com/htacg/tidy-html5/issues/901)
- Need help controlling output [\#894](https://github.com/htacg/tidy-html5/issues/894)
- Say how to deal with XHTML input [\#893](https://github.com/htacg/tidy-html5/issues/893)
- Help output refers to a non-existent -options option [\#892](https://github.com/htacg/tidy-html5/issues/892)
- Tidy gets confused with u tags and underline styles [\#890](https://github.com/htacg/tidy-html5/issues/890)
- how to forbid auto insert tag? [\#889](https://github.com/htacg/tidy-html5/issues/889)
- Incorrectly changing — to - \(emdash \[alt 0151\]\) to hypens. [\#885](https://github.com/htacg/tidy-html5/issues/885)
- html-tidy site does not work with https [\#883](https://github.com/htacg/tidy-html5/issues/883)
- Use with TextPad 8 [\#882](https://github.com/htacg/tidy-html5/issues/882)
- Translation: TidyKeepTabs [\#880](https://github.com/htacg/tidy-html5/issues/880)
- \<img\> proprietary attribute "loading" [\#879](https://github.com/htacg/tidy-html5/issues/879)
- Versioning seems a bit off [\#877](https://github.com/htacg/tidy-html5/issues/877)
- --quote-ampersand yes doesn't work [\#876](https://github.com/htacg/tidy-html5/issues/876)
- Convert spaces to non-breaking space [\#875](https://github.com/htacg/tidy-html5/issues/875)
- Tidy 5.6.0 mangled html / php code. [\#872](https://github.com/htacg/tidy-html5/issues/872)
- Even with -utf8 tidy replaces UTF8 code U+00A0 into numeric entity &\#160; [\#871](https://github.com/htacg/tidy-html5/issues/871)
- http-equiv metas should trigger helpful upgrade messages [\#868](https://github.com/htacg/tidy-html5/issues/868)
- HTML Tidy website does not render propertly when using HTTPS [\#867](https://github.com/htacg/tidy-html5/issues/867)
- \[-Wignored-qualifiers\] warning in tidy [\#866](https://github.com/htacg/tidy-html5/issues/866)
- Wrong character encoding [\#863](https://github.com/htacg/tidy-html5/issues/863)
- Missing semicolon after html entity sometimes returns generic 'unknown entity' warning instead of specific 'missing semicolon' [\#862](https://github.com/htacg/tidy-html5/issues/862)
- Warning: unescaped & or unknown entity "&P" when encoding as utf-8 [\#861](https://github.com/htacg/tidy-html5/issues/861)
- Tidy output clutter [\#857](https://github.com/htacg/tidy-html5/issues/857)
- Trailing backspace removed [\#856](https://github.com/htacg/tidy-html5/issues/856)
- Only wrap at tags [\#854](https://github.com/htacg/tidy-html5/issues/854)
- ENABLE\_DEBUG\_LOG is ignored on Windows [\#852](https://github.com/htacg/tidy-html5/issues/852)
- Kill off alphabetical ordering clause for publicly-exposed enum defs [\#851](https://github.com/htacg/tidy-html5/issues/851)
- For Sublime Text 3 [\#849](https://github.com/htacg/tidy-html5/issues/849)
- \<li\> tags skipped in tidy result shown on screen [\#847](https://github.com/htacg/tidy-html5/issues/847)
- man page missing header causing appending to XML discussion [\#846](https://github.com/htacg/tidy-html5/issues/846)
- \<input type="file"\> needs name= [\#845](https://github.com/htacg/tidy-html5/issues/845)
- Expose node-\>last in the public API [\#844](https://github.com/htacg/tidy-html5/issues/844)
- Support EJS? [\#842](https://github.com/htacg/tidy-html5/issues/842)
- Tidy 5.2 cleaned up curly quotes but 5.6 doesn't [\#841](https://github.com/htacg/tidy-html5/issues/841)
- Jekyll headings removed [\#840](https://github.com/htacg/tidy-html5/issues/840)
- Should tidy allow an empty title element? [\#839](https://github.com/htacg/tidy-html5/issues/839)
- Missing tags for 5.7.\* [\#834](https://github.com/htacg/tidy-html5/issues/834)
- Python binding? [\#826](https://github.com/htacg/tidy-html5/issues/826)
- Self-closing tags are not correctly recognized [\#813](https://github.com/htacg/tidy-html5/issues/813)
- Different output when parsing HTML [\#790](https://github.com/htacg/tidy-html5/issues/790)
- Continuously fuzzing tidy-html5 with OSS-Fuzz [\#788](https://github.com/htacg/tidy-html5/issues/788)
- I18N isn't working \(mostly\) via changing the environment variables [\#783](https://github.com/htacg/tidy-html5/issues/783)
- 5.6.0 and breakage with php-tidy [\#780](https://github.com/htacg/tidy-html5/issues/780)
- Tidy needs a changelog [\#776](https://github.com/htacg/tidy-html5/issues/776)
- TidyNodeGetText returns text with a new line appended [\#775](https://github.com/htacg/tidy-html5/issues/775)
- Breaks microseconds after call tidy\_repair\_string [\#771](https://github.com/htacg/tidy-html5/issues/771)
- Typos in language\_en.h, etc [\#765](https://github.com/htacg/tidy-html5/issues/765)
- Document accessibility priority numbers better [\#756](https://github.com/htacg/tidy-html5/issues/756)
- Xcode not working with tidylib [\#751](https://github.com/htacg/tidy-html5/issues/751)
- Intent-To-Package: Snaps are Universal Linux Packages [\#748](https://github.com/htacg/tidy-html5/issues/748)
- Can't parse UTF16 html string [\#744](https://github.com/htacg/tidy-html5/issues/744)
- libtidy.so.5 has removed symbols between 5.2.0 and 5.6.0, but kept SONAME [\#743](https://github.com/htacg/tidy-html5/issues/743)
- Tidy 5.7.16 -\> empty result [\#740](https://github.com/htacg/tidy-html5/issues/740)
- Crash with malformed \<meta\> tag [\#739](https://github.com/htacg/tidy-html5/issues/739)
- bug\(encoding\): non-ASCII characters in configuration file [\#737](https://github.com/htacg/tidy-html5/issues/737)
- Improve documentation re: wrap-script-literals [\#736](https://github.com/htacg/tidy-html5/issues/736)
- feature\_request\(validation\): “preserve-entities yes” by default [\#732](https://github.com/htacg/tidy-html5/issues/732)
- Tidy emits warnings that aren't in order [\#696](https://github.com/htacg/tidy-html5/issues/696)
- Option to disable tidy code fixing option [\#693](https://github.com/htacg/tidy-html5/issues/693)
- tidy change html view when deal with white-space:pre tag [\#685](https://github.com/htacg/tidy-html5/issues/685)
- CLI option to stop insertion/deletion of tags [\#682](https://github.com/htacg/tidy-html5/issues/682)
- Tidy does not strip leading and trailing spaces in HTML href [\#678](https://github.com/htacg/tidy-html5/issues/678)
- Use tidy with json custom attributes on custom components [\#677](https://github.com/htacg/tidy-html5/issues/677)
- \[Question\] How to use tidy for multiple files? [\#668](https://github.com/htacg/tidy-html5/issues/668)
- How to run a test-kit from terminal? [\#667](https://github.com/htacg/tidy-html5/issues/667)
- Dependency on DLLs not Documented [\#666](https://github.com/htacg/tidy-html5/issues/666)
- tidylib.c fails to compile on Visual Studio 2010 [\#665](https://github.com/htacg/tidy-html5/issues/665)
- Minify HTML [\#628](https://github.com/htacg/tidy-html5/issues/628)
- Do not insert newlines into TEXT when wrapping! [\#625](https://github.com/htacg/tidy-html5/issues/625)
- Configuration Options "cleanup" [\#609](https://github.com/htacg/tidy-html5/issues/609)
- Next Release 5.6.0 [\#600](https://github.com/htacg/tidy-html5/issues/600)
- anchor-as-name: false replaces name attribute of a form tag with id attribute [\#571](https://github.com/htacg/tidy-html5/issues/571)
- Why does tidy format the '\<' and '\>' numeric operator? [\#485](https://github.com/htacg/tidy-html5/issues/485)
- span with display: inline-block is treated as inline [\#448](https://github.com/htacg/tidy-html5/issues/448)
- wrap-php multiple lines [\#437](https://github.com/htacg/tidy-html5/issues/437)
- Option to always encode double ampersands [\#827](https://github.com/htacg/tidy-html5/issues/827)
- \[ENH\] Add meta options to disable/enable cleanup and repair option [\#819](https://github.com/htacg/tidy-html5/issues/819)
- --vertical-space yes adds too much after comment [\#811](https://github.com/htacg/tidy-html5/issues/811)
- Line breaking on "|" [\#810](https://github.com/htacg/tidy-html5/issues/810)
- Installs library in /usr/local/lib/lib instead of /usr/local/lib [\#807](https://github.com/htacg/tidy-html5/issues/807)
- Publishing in VS2015 - System.DllNotFoundException [\#804](https://github.com/htacg/tidy-html5/issues/804)
- can not fix script async Attr to async="async" [\#799](https://github.com/htacg/tidy-html5/issues/799)
- Feature Request: Omit boilerplate [\#795](https://github.com/htacg/tidy-html5/issues/795)
- html conversion to xml leaves many tags unclosed [\#792](https://github.com/htacg/tidy-html5/issues/792)
- NppTidy 5.6.0 quickref.html link broken - please fix [\#787](https://github.com/htacg/tidy-html5/issues/787)
- Redundant blank lines when printing -help [\#781](https://github.com/htacg/tidy-html5/issues/781)
- --css-prefix option no longer adds a hyphen to its built classes [\#777](https://github.com/htacg/tidy-html5/issues/777)
- Build error on Android \(Termux\): unknown type name 'ulong' [\#773](https://github.com/htacg/tidy-html5/issues/773)
- alter default config file processing [\#772](https://github.com/htacg/tidy-html5/issues/772)
- Tidy output going to stderr [\#763](https://github.com/htacg/tidy-html5/issues/763)
- --tidy-mark no inserts blank line [\#760](https://github.com/htacg/tidy-html5/issues/760)
- tidy -access: \<doctype\> NOT missing [\#758](https://github.com/htacg/tidy-html5/issues/758)
- type qualifiers ignored on function return type \[-Werror=ignored-qualifiers\] [\#746](https://github.com/htacg/tidy-html5/issues/746)
- tidy dies on unexpected character [\#745](https://github.com/htacg/tidy-html5/issues/745)
- tidy 5.6.0 warning `inserting missing 'title' element` appears in php-only files [\#728](https://github.com/htacg/tidy-html5/issues/728)
- bug\(build\): tidyBufAppend\(&buf1, d-\>def, strlen\(d-\>def\)\); [\#721](https://github.com/htacg/tidy-html5/issues/721)
- Allow specify ranges of code that do not get checked [\#720](https://github.com/htacg/tidy-html5/issues/720)
- README/CONTRIBUTING.md [\#718](https://github.com/htacg/tidy-html5/issues/718)
- tidy's error messages should include filename somewhere [\#713](https://github.com/htacg/tidy-html5/issues/713)
- Tidy does not complain about valign in \<tr\>, \<th\> or \<td\> [\#711](https://github.com/htacg/tidy-html5/issues/711)
- tidy converts '&' in query parameters \(&aen=true =\> &amp;aen=true\) in relative paths [\#710](https://github.com/htacg/tidy-html5/issues/710)
- TidyHtml not working properly in C++ [\#707](https://github.com/htacg/tidy-html5/issues/707)
- Unescaped `&` emitted despite using \*\*output-xhtml\*\* key bindings in 5.6.0 in PHP bindings [\#704](https://github.com/htacg/tidy-html5/issues/704)
- How to ignore specific warnings [\#699](https://github.com/htacg/tidy-html5/issues/699)
- Mention the need for a `:` before options' value in the configuration file [\#698](https://github.com/htacg/tidy-html5/issues/698)
- Tidy 5.6.0 -\> bug with pre tag [\#690](https://github.com/htacg/tidy-html5/issues/690)
- Is there any way to remove inline styles? [\#689](https://github.com/htacg/tidy-html5/issues/689)
- feature request\(safari\): Pinned Tab Icons support [\#686](https://github.com/htacg/tidy-html5/issues/686)
- Adopt Cygwin tidy package [\#680](https://github.com/htacg/tidy-html5/issues/680)
- Clarification on releases / release tarballs missing [\#676](https://github.com/htacg/tidy-html5/issues/676)
- --fix-uri no does not turn off check [\#675](https://github.com/htacg/tidy-html5/issues/675)
- Unexpected behavior of 'add-xml-space' setting when used with 'wrap' =\> 0 and saveBuffer is called twice in tidy-html5 5.6.0 [\#673](https://github.com/htacg/tidy-html5/issues/673)
- show-body-only [\#672](https://github.com/htacg/tidy-html5/issues/672)
- Tidy deletes empty tags [\#669](https://github.com/htacg/tidy-html5/issues/669)
- unbalanced \#endif's [\#663](https://github.com/htacg/tidy-html5/issues/663)
- Feature request: option to replace inline styles with classes + `<style>` tag styles [\#638](https://github.com/htacg/tidy-html5/issues/638)
- Windows 32-bit XP Release [\#568](https://github.com/htacg/tidy-html5/issues/568)
- Release an updated HTML::Tidy perl library [\#562](https://github.com/htacg/tidy-html5/issues/562)
- \<Script\> tag gets removed [\#528](https://github.com/htacg/tidy-html5/issues/528)
- Word filtered html doesn't convert accents to utf8 [\#512](https://github.com/htacg/tidy-html5/issues/512)
- option to ignore attribute-errors if attribute contains pseudo-elements [\#505](https://github.com/htacg/tidy-html5/issues/505)
- Allow \<div\> inside \<pre\> [\#479](https://github.com/htacg/tidy-html5/issues/479)
**Merged pull requests:**
- Fixes \#743. [\#966](https://github.com/htacg/tidy-html5/pull/966) (@balthisar)
- Fixed merge conflict; fixed non-build issue on macOS. RC for testing. [\#965](https://github.com/htacg/tidy-html5/pull/965) (@balthisar)
- README.md: add Wikidata link [\#961](https://github.com/htacg/tidy-html5/pull/961) (@vitaly-zdanevich)
- Fix issues with user-specified settings changing [\#959](https://github.com/htacg/tidy-html5/pull/959) (@balthisar)
- Automated Testing [\#957](https://github.com/htacg/tidy-html5/pull/957) (@balthisar)
- simple fix for the range of the condition. [\#953](https://github.com/htacg/tidy-html5/pull/953) (@ihsinme)
- Add muted and playsinline video attributes for HTML5. [\#949](https://github.com/htacg/tidy-html5/pull/949) (@drichardson)
- Add German Language [\#943](https://github.com/htacg/tidy-html5/pull/943) (@balthisar)
- Link macOS console application with required plist [\#942](https://github.com/htacg/tidy-html5/pull/942) (@balthisar)
- Is. \#839 - new message for 'blank' title [\#930](https://github.com/htacg/tidy-html5/pull/930) (@geoffmcl)
- Support extended color names in HTML 5 validation [\#914](https://github.com/htacg/tidy-html5/pull/914) (@cqcallaw)
- Fix percentage validation in CheckLength [\#912](https://github.com/htacg/tidy-html5/pull/912) (@cqcallaw)
- Add SVG paint attributes [\#907](https://github.com/htacg/tidy-html5/pull/907) (@cqcallaw)
- Is. \#879: add loading attribute for img, iframe [\#902](https://github.com/htacg/tidy-html5/pull/902) (@sidvishnoi)
- COMPILE\_FLAGS property only once per target, avoid overwriting. [\#886](https://github.com/htacg/tidy-html5/pull/886) (@SvenPStarFinanz)
- Complete pt\_br translation [\#881](https://github.com/htacg/tidy-html5/pull/881) (@hugotiburtino)
- Support the \<slot\> tag [\#848](https://github.com/htacg/tidy-html5/pull/848) (@lhchavez)
- Issue \#437 - re-use of 'wrap-php' option [\#645](https://github.com/htacg/tidy-html5/pull/645) (@geoffmcl)
- Change "tidyLocalMapItem" to "tidyLocaleMapItem" [\#829](https://github.com/htacg/tidy-html5/pull/829) (@MrSorcus)
- added OS \_\_ANDROID\_\_ in tidyplatform.h [\#823](https://github.com/htacg/tidy-html5/pull/823) (@naveedpash)
- Update BRANCHES.md [\#793](https://github.com/htacg/tidy-html5/pull/793) (@SConaway)
- Is. \#783 - Fix language detection [\#785](https://github.com/htacg/tidy-html5/pull/785) (@Lin-Buo-Ren)
- Is. \#781 - Drop redundant blank lines in -help [\#782](https://github.com/htacg/tidy-html5/pull/782) (@Lin-Buo-Ren)
- Issue 649 adding tag \<data\> [\#769](https://github.com/htacg/tidy-html5/pull/769) (@AntoniosHadji)
- Issue 752 [\#764](https://github.com/htacg/tidy-html5/pull/764) (@geoffmcl)
- PHP ≥ 7.1.0 recognizes tidy-html5 [\#762](https://github.com/htacg/tidy-html5/pull/762) (@cmb69)
- Fix typo [\#753](https://github.com/htacg/tidy-html5/pull/753) (@Lin-Buo-Ren)
- Fix extra const modifier [\#747](https://github.com/htacg/tidy-html5/pull/747) (@drizt)
- Is \#721 - cast away some gcc warnings [\#722](https://github.com/htacg/tidy-html5/pull/722) (@geoffmcl)
- Doc nits [\#717](https://github.com/htacg/tidy-html5/pull/717) (@ler762)
- Is \#709 - Improve message if 'implict' [\#714](https://github.com/htacg/tidy-html5/pull/714) (@geoffmcl)
- Make global attribute `dir` accept auto as well. [\#712](https://github.com/htacg/tidy-html5/pull/712) (@doronbehar)
- Is \#697 - Add NOWRAP to print of pre tag [\#708](https://github.com/htacg/tidy-html5/pull/708) (@geoffmcl)
- Is \#700 - change script parsing if in html5 mode [\#703](https://github.com/htacg/tidy-html5/pull/703) (@geoffmcl)
- Issue 698 - docs update [\#702](https://github.com/htacg/tidy-html5/pull/702) (@geoffmcl)
- Is \#686 - Add attr COLOR to W3CAttrsFor\_LINK [\#701](https://github.com/htacg/tidy-html5/pull/701) (@geoffmcl)
- Issue 679 [\#695](https://github.com/htacg/tidy-html5/pull/695) (@geoffmcl)
- Issue 663 - fixes for Haiku port [\#664](https://github.com/htacg/tidy-html5/pull/664) (@geoffmcl)
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

27
README/CODESTYLE.md Normal file
View File

@ -0,0 +1,27 @@
# HTML Tidy Code Style
The source code of **libTidy** and console app **tidy** mostly follow the preferences of the original maintainers. Perhaps some of these decisions were arbitrary and based on their sense of aesthetics at the time, but it is good to have all the code looking the same even if it is not exactly what everyone would prefer.
Developers adding code to HTML Tidy are urged to try to follow the existing code style. Code that does not follow these conventions may be accepted, but may be modified as time goes by to best fit the “Tidy Style.”
There has been a suggestion of using available utilities to make the style consistent, like [Uncrustify](https://github.com/uncrustify/uncrustify) - see [issue #245](https://github.com/htacg/tidy-html5/issues/245), and maybe others.
Others have suggested the [AStyle](http://astyle.sourceforge.net/) formatting program with say `-taOHUKk3 -M8` arguments, to conform, but there are a few bugs in AStyle.
But again, these and other tools may not produce code that everybody agrees with, and are presently not formally used in Tidy!
#### Known Conventions
From reading of the Tidy source, some things are self evident, in no particular order...
- Use of 4-space indenting, and no tabs.
- No C++ single line comments using `//`.
- The opening `{` is indented on the next newline.
- While the maximum code line length varies, generally long `if`, `while`, ... statements are wrapped to newlines.
- Pointer operators in declarations must precede any macro documentation, e.g, `const tidyLocaleMapItem* TIDY_CALL getNextWindowsLanguage( TidyIterator* iter )` instead of `const tidyLocaleMapItem TIDY_CALL *getNextWindowsLanguage( TidyIterator* iter )` in case `TIDY_CALL` is defined.
Look forward to this document being filled out in detail...
Date: 20150904

99
README/CONTRIBUTING.md Normal file
View File

@ -0,0 +1,99 @@
# Contributing to HTML Tidy
So you want to contribute to Tidy? Fantastic! Here's a brief overview on how best to do so.
### Support request
If you are having trouble running console `Tidy`, or using the `LibTidy` API in your own project, then maybe the best places to get help is either via a comment in [Tidy Issues](https://github.com/htacg/tidy-html5/issues), or on the [Tidy Mail Archive](https://lists.w3.org/Archives/Public/html-tidy/) list.
And please do a **search** using different **key** words - see [searching](https://help.github.com/articles/searching-issues-and-pull-requests/) - to make sure it is **not** a duplicate. If something similar has been discussed before, but you still feel this is **different**, then add that related reference in your post...
In either place please start with a short subject to describe the issue. If it involves running Tidy on an html file, or if its an API question, make sure to include:
- the version: `$ tidy -v`
- what was the configuration used
- a small sample input
- 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.
If you are able to build tidy from [source](https://github.com/htacg/tidy-html5) (requires [CMake](https://cmake.org/download/)), and you can find the problem in the source code, then read on about how you can create a Pull Request (“PR”) to share your code and ideas.
### What to change
Here are some examples of things you might want to make a PR for:
- New features
- Bug fixes
- Inefficient blocks of code
- Memory problems
- Language translations
If you have a more deeply-rooted problem with how the program is built or some of the stylistic decisions made in the code, it is best to [create an issue](https://github.com/htacg/tidy-html5/issues/new) before putting the effort into a pull request. The same goes for new features - it might be best to check the project's direction, existing pull requests, and currently open and closed issues first.
Concerning the “Tidy Code Style,” checkout [CODESTYLE.md](CODESTYLE.md), but looking at existing code is the best way to get a good feel for the patterns we use.
### Using Git appropriately
1. Fork tidy to your own github account. Use top right `Fork` icon.
2. Optional: Generate a SSH Key, and add it to your `https://github.com/<name>` settings, SSH and GPG keys
3. Clone your own fork - `$ git clone git@github.com:<name>/tidy-html5.git [tidy-fork]` Or using `https`.
4. Create a branch - `$ cd tidy-fork; $ git checkout -b <branch-name>`
5. Edit, and commit your changes to this `branch` of your fork.
6. Test your changes, and if appropriate run [regression](https://github.com/htacg/tidy-html5-tests/blob/next/README/RUNTESTS.md) tests.
7. Publish the branch - `$ git push -u origin <branch-name.` - to your remote fork.
8. Create a [Pull Request](https://help.github.com/articles/about-pull-requests/), a **PR**, here.
9. Watch for comments, acceptance.
Item 2., SSH Key, is optional, and only required if you want to use `clone git@github.com...`. 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.
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**.
See below on keeping your forks `next` fully in sync with here, called `upstream` - **this is important**.
```
$ git remote add upstream git@github.com:htacg/tidy-html5.git # once only
$ git checkout next
$ git status
$ git stash # if not clean
$ git fetch upstream
$ git rebase upstream/next
$ git stash pop # if required, and fix conflicts
$ git push # update the fork next
```
This has to be repeated for other branches, too. `$ git checkout <your-branch>`, `$ git rebase next`, fix conflict, if any, and `$ git push`, for **each** branch. It is **not** fun to keep multiple `branches` fully up-to-date with an active `upstream`...
Of course, the **regression** tests, 6., are really only if you have made `code` changes, but it is a good habit to get into. As can be seen the `tests` are in a **separate** repo, so you must also clone that, or **fork** and clone that, to be able to present a **PR**. This is best done in the same `root` folder where where you cloned `tidy-html5`, and your `tidy-fork`. See [RUNTESTS.md](https://github.com/htacg/tidy-html5-tests/blob/next/README/RUNTESTS.md).
In brief, for unix, to use your potentially **new** `tidy-fork` tidy executable -
```
$ git clone git@github.com:htacg/tidy-html5-tests.git
$ cd tidy-html5-tests/tools-sh
$ ./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`.
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**.
Do **NOT** change either the root `version.txt` here, nor the `cases/_version.txt` in `tests`. This will be handled by the person that does the **PR** merge. To differentiate your modified `tidy` there is a cmake option, like `-DTIDY_RC_NUMBER=I123`, which will appear in `tidy -v` as `5.7.16.I123`. The number can be anything, but using the relevant issue value is a good choice.
Add an `issue` if you need further **help**... thanks...
### Help Tidy Get Better
It goes without saying **all help is appreciated**. We need to work together to make Tidy better!

View File

@ -2,11 +2,24 @@
## HTML parser and pretty printer
Copyright (c) 1998-2003 World Wide Web Consortium
Copyright (c) 1998-2016 World Wide Web Consortium
(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,
@geoffmcl, HTACG, and others.
### Contributing Author(s):
Dave Raggett <dsr@w3.org>
The contributing author(s) would like to thank all those who
helped with testing, bug fixes and suggestions for improvements.
This wouldn't have been possible without your help.
## COPYRIGHT NOTICE:
This software and documentation is provided "as is," and
the copyright holders and contributing author(s) make no
representations or warranties, express or implied, including

50
README/LICENSE.txt Normal file
View File

@ -0,0 +1,50 @@
# HTML Tidy
## HTML parser and pretty printer
Copyright (c) 1998-2016 World Wide Web Consortium
(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,
@geoffmcl, HTACG, and others.
### Contributing Author(s):
Dave Raggett <dsr@w3.org>
The contributing author(s) would like to thank all those who
helped with testing, bug fixes and suggestions for improvements.
This wouldn't have been possible without your help.
## COPYRIGHT NOTICE:
This software and documentation is provided "as is," and
the copyright holders and contributing author(s) make no
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.
The copyright holders and contributing author(s) will not be held
liable for any direct, indirect, special or consequential damages
arising out of any use of the software or documentation, even if
advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute
this source code, or portions hereof, documentation and executables,
for any purpose, without fee, subject to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must
not be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The copyright holders and contributing author(s) specifically
permit, without fee, and encourage the use of this source code
as a component for supporting the Hypertext Markup Language in
commercial products. If you use this source code in a product,
acknowledgement is not required but would be appreciated.

19
README/LOCALIZE.md Normal file
View File

@ -0,0 +1,19 @@
# Localize HTML Tidy
HTML Tidy is used worldwide but is not very friendly to non-English speakers.
The latest versions of HTML Tidy and `libtidy` now support other languages and
regional variations, but we need your help to make it accessible to these users
by using your knowledge of other languages to make Tidy better.
Help us translate HTML Tidy into another language and as part of our project
team you will certainly earn the admiration of fellow Tidy users worldwide.
## How to Contribute
All READMEs (including [instructions][2] on how to localize Tidy) and related
materials can be found in [localize][1].
[1]: ../localize
[2]: ../localize/README.md

41
README/MESSAGES.md Normal file
View File

@ -0,0 +1,41 @@
# Message System
Tidy has a quite complex warning/error report and footnote messaging system, but most of this complexity is completely hidden away from you in order to make adding messages as simple as possible. This particular README instructs you how to add a new warning/error report to **libTidy**.
First assign the message a **key** value. This is done in `tidyenum.h`, in one of the two enumerations that are listed there.
1. `tidyStrings` - starts with the value `TIDYSTRINGS_FIRST = 500`, and it must be first. This is the list of all strings available in Tidy with the exception of strings provided by other enumerations. **However** don't modify this enum directly. You'll modify a preprocessor macro instead.
2. `TidyOptionId` - You probably won't need this unless you're adding new options, and there's another readme for that.
3. `TidyConfigCategory` - You probably won't need this, either, unless you're adding a whole new category for options.
4. `TidyReportLevel` - And you probably won't need this, either.
All enum values are only ever used by name within **libTidy** (and incidentally, should only ever be used by name in your client applications; never trust the value!), so feel free to enter new strings in English alphabetical order (this helps us audit all of the strings from time to time).
As mentioned above, `tidyStrings` messages must be defined in one of the existing macros named like `FOREACH_...(FN)`, such as `FOREACH_DIALOG_MSG(FN)`. These macros ensure that another data structure used for localization and key lookup is updated automatically any time strings are added or removed, thus limiting the possibility of developer error.
## Step 1
So in this case I want to add 3 warning messages: `BAD_SURROGATE_PAIR`, `BAD_SURROGATE_TAIL`, and `BAD_SURROGATE_LEAD`. Because these are error reports, they belong in the `tidyStrings` enum, and they fit into nicely into the macro beginning `FOREACH_REPORT_MSG(FN)`. Add the message key values into this macro, ensuring they are nested in the `FN()` syntax.
## Step 2
The next step is adding a `format` string to `language_en.h`. This string may later be translated to various supported language strings, but even if you wish to support another language, its critical that you add the message format string to `language_en.h`, which serves as the base language for `LibTidy`.
Where to add this seems a bit of a mess, but in general things are grouped by where they're used in `libTidy`, and often in alphabetical order within those groups. Here I've added them in alphabetical order in the section where all of the other report messages are.
Depending on which of the output routines you use (consult `message.c`) you may be able to use parameters such as `%u` and `%s` in your format strings. The available data is currently limited to the available message output routines. Please don't use `printf` for message output within **libTidy**.
Note that Tidy doesn't currently support numbered `printf` parameters; parameters will be consumed in the order the report output function calls them.
## Step 3
The last step — hopefully — is adding the message key to the `dispatchTable[]` structure in `message.c`. This structure determines the `TidyReportLevel` (report severity) and message formatter (how to print the message). Then whenever you issue the report with `TY_(Report)()` or one of the existing convenience report functions, the correct message formatter will be used for the parameters that you specify.
Please read the source code in `message.c` for help on how to choose a message formatter, or how to modify one of the existing message formatters if you need to accommodate a new function signature for your report.
eof;

134
README/OPTIONS.md Normal file
View File

@ -0,0 +1,134 @@
# Tidy Config Options
Tidy supports a quite large number of configuration options. The full list can be output using `-help-config`. This will show the option to be used either on the command line or in a configuration file, the type of option, and the value(s) that can be used. The current default value for each option can be seen using `-show-config`.
The options can also be listed in xml format. `-xml-help` will output each option plus a description. `-xml-config` will not only output the option and a description, but will include the type, default and examples. These xml outputs are used, with the aid of `xsltproc` and `doxygen`, to generate the [API Documentation](https://api.html-tidy.org/).
These options can also be used by application linking with `libtidy`. For each option there is a `TidyOptionId` enumeration in the `tidyenum.h` file, and get/set functions for each option type.
This file indicates how to add a new option to tidy, here adding an option `TidyEscapeScripts`. In essence it consists of 4 steps:
1. Add the option `ID` to `tidyenum.h`.
2. Add to the `table` `TidyOptionImpl option_defs[]` in `config.c`
3. Add the id, with a `description` to `language_en.h`
4. Use the option in the code.
#### 1. Option ID
In `tidyenum.h` the `TidyOptionId` can be in any order, but please try to keep things alphabetical, and keep in mind that `N_TIDY_OPTIONS` must remain the last. Choosing the id name can be any string, but by convention it will commence with `Tidy` followed by brief descriptive text.
Naturally it can not be the same as any existing option. That is, it must be unique. And it will be followed by a brief descriptive special doxygen formatted comment. So for this new option I have chosen -
~~~
TidyEscapeScripts, /**< Escape items that look like closing tags */
~~~
#### 2. Table Definition
In `config.c`, added in `TidyOptionImpl option_defs[]`. Again it can be in any order, but normally a new option would be added just before the last `N_TIDY_OPTIONS`, which must remain the last.
The structure definition of the table entries is simple -
~~~
struct _tidy_option
{
TidyOptionId id;
TidyConfigCategory category; /* put 'em in groups */
ctmbstr name; /* property name */
TidyOptionType type; /* string, int or bool */
ulong dflt; /* default for TidyInteger and TidyBoolean */
ParseProperty* parser; /* parsing method, read-only if NULL */
PickListItems* pickList; /* pick list */
ctmbstr pdflt; /* default for TidyString */
};
~~~
Naturally it will commence with the above chosen unique `id`.
The `category` will be one of this enumeration -
~~~
typedef enum
{
TidyMarkup, /**< Markup options: (X)HTML version, etc */
TidyDiagnostics, /**< Diagnostics */
TidyPrettyPrint, /**< Output layout */
TidyEncoding, /**< Character encodings */
TidyMiscellaneous, /**< File handling, message format, etc. */
TidyInternalCategory /**< Option is internal only. */
} TidyConfigCategory;
~~~
Care, each of these enumeration strings have been equated to 2 uppercase letters. If you feel there should be another `category` or group then this can be discussed, and added.
The `name` can be anything, but should try to be somewhat descriptive of the option. Again this string must be unique. It should be lowercase alphanumeric characters, and can contain a `-` separator. Remember this is the name places on the command line, or in a configuration file to set the option.
The `type` is one of the following enumeration items -
~~~
typedef enum
{
TidyString, /**< String */
TidyInteger, /**< Integer or enumeration */
TidyBoolean /**< Boolean flag */
} TidyOptionType;
~~~
Care, each of these enumeration strings have been equated to two uppercase letters. If you feel there should be another `type` then this can be discussed, but would require other additional things. And also note the `TidyTriState` is the same as a `TidyInteger` except uses its own parser.
The next item is the `default` value for a boolean, tristate or integer. Note tidy set `no=0` and `yes=1` as its own `Bool` enumeration.
There are a number of `parser` for the options. Likewise a number of `pickList`. Find another option similar to your new option and use the same values. The `parser` is the function that parses config file or command line text input, and the `picklist` constitutes the canonical values for the option. Some types of values logically don't have picklists, such as strings or pure integers.
Presently no options have the final `default` string, and it is left out of the table. The compiler will add a NULL.
The final table entry added. Note in here the spacing has been compressed, but in the actual code the current column settings should be maintained if possible -
~~~
{ TidyEscapeScripts, PP, "escape-scripts", BL, yes, ParseBool, boolPicks[, NULL] }, /* 20160227 - Issue #348 */
~~~
#### 3. Option Description
In `language_en.h`, in the section labelled **Options Documentation**. Please try to keep this in alphabetical order.
Each entry is a structure with 3 members -
~~~
typedef struct languageDictionaryEntry {
uint key;
uint pluralForm;
ctmbstr value;
} languageDictionaryEntry;
~~~
The `key` is the option `ID`; The `pluralForm` is not used for options, and should be `0`; The `value` is the description string.
Some care has to be taken with the description string. The only html allowed here is `<code>...</code>`, `<var>...</var>`, `<em>...</em>`, `<strong>...</strong>`, and `<br/>`. Entities, tags, attributes, etc., should be enclosed in `<code>...</code>`. Option values should be enclosed in `<var>...</var>`. It's very important that `<br/>` be self-closing! This string is processed to build the API documentation.
This is the description added for this new option.
~~~
{
TidyEscapeScripts, 0,
"This option causes items that look like closing tags, like <code>&lt;/g</code> to be "
"escaped to <code>&lt;\\/g</code>. Set this option to 'no' if you do not want this."
},
~~~
#### 4. Use in Code
This can be added anywhere in the code to change the current code action. While the testing of the option depends on the option type, the most common is `cfgBool( doc, id )`. Here is an example of where this new option is used -
~~~
/*\ if javascript insert backslash before /
* Issue #348 - Add option, escape-scripts, to skip
\*/
if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts))
{
~~~
#### Summary
That's about it. Just 4 places. Obviously the best idea it to search for an existing option `ID`, and follow where it is all defined and used, and copy that. It is not difficult.
; eof 20160310

57
README/README.html Normal file
View File

@ -0,0 +1,57 @@
<h1 id="htacghtmltidy">HTACG HTML Tidy</h1>
<h2 id="prerequisites">Prerequisites</h2>
<ol>
<li><p>git - <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">https://git-scm.com/book/en/v2/Getting-Started-Installing-Git</a></p></li>
<li><p>cmake - <a href="https://cmake.org/download/">https://cmake.org/download/</a></p></li>
<li><p>appropriate build tools for the platform</p></li>
<li><p>the <a href="http://xmlsoft.org/XSLT/xsltproc2.html">xsltproc</a> tool is required to build and install the <code>tidy.1</code> man page on Unix-like platforms.</p></li>
</ol>
<p>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.</p>
<p>Also the actual build tools vary for each platform. But that is one of the great features of CMake, it can generate various &#8216;native&#8217; build files. Running <code>cmake --help</code> should list the generators available on that platform. For sure one of the common ones is &#8220;Unix Makefiles&#8221;, which needs autotools make installed, but many other generators are supported.</p>
<p>In Windows CMake offers various versions for MSVC. Again below only the command line use of MSVC is shown, but the tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building done in there.</p>
<h2 id="buildthetidylibraryandcommandlinetool">Build the tidy library and command line tool</h2>
<ol>
<li><p><code>cd build/cmake</code></p></li>
<li><p><code>cmake ../.. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/path/for/install]</code></p></li>
<li><p>Windows: <code>cmake --build . --config Release</code><br/>
Unix/OS X: <code>make</code></p></li>
<li><p>Install, if desired:<br/>
Windows: <code>cmake --build . --config Release --target INSTALL</code><br/>
Unix/OS X: <code>[sudo] make install</code></p></li>
</ol>
<p>By default cmake sets the install path to <code>/usr/local/bin</code> in Unix. If you wanted the binary in say <code>/usr/bin</code> instead, then in 2. above use <code>-DCMAKE_INSTALL_PREFIX=/usr</code>.</p>
<p>Also, in Unix if you want to build the release library without any debug <code>assert</code> in the code then add <code>-DCMAKE_BUILD_TYPE=Release</code> in step 2. This adds a <code>-DNDEBUG</code> macro to the compile switches. This is normally added in windows build for the <code>Release</code> config.</p>
<p>In Windows the default install is to <code>C:\Program Files\tidy</code>, or <code>C:/Program Files (x86)/tidy</code>, which is not very useful. After the build the <code>tidy.exe</code> is in the <code>Release</code> directory, and can be copied to any directory in your <code>PATH</code> environment variable for global use.</p>
<p>If you do <strong>not</strong> need the tidy library built as a &#8216;shared&#8217; (DLL) library, then in 2. add the command <code>-DBUILD_SHARED_LIB:BOOL=OFF</code>. This option is <strong>ON</strong> by default. The static library is always built and linked with the command line tool for convenience in Windows, and so the binary can be run as part of the man page build without the shared library being installed in unix.</p>
<p>See the <code>CMakeLists.txt</code> file for other CMake <strong>options</strong> offered.</p>
<h2 id="buildphpwiththetidy-html5library">Build PHP with the tidy-html5 library</h2>
<p>Due to API changes in the PHP source, <code>buffio.h</code> needs to be renamed to <code>tidybuffio.h</code> in the file <code>ext/tidy/tidy.c</code> in PHP&#8217;s source.</p>
<p>That is - prior to configuring PHP run this in the PHP source directory:
<code>
sed -i 's/buffio.h/tidybuffio.h/' ext/tidy/*.c
</code></p>
<p>And then continue with (just an example here, use your own PHP config options):</p>
<pre><code>./configure --with-tidy=/usr/local
make
make test
make install
</code></pre>
<p>; eof</p>

186
README/RELEASE.md Normal file
View File

@ -0,0 +1,186 @@
HTML Tidy Release Process Single Point Lesson (SPL)
===================================================
Purpose
-------
This lesson documents how to release a new, officially released version of HTML Tidy. Following the steps in this SPL ensures consistency between releases and results in a predictable experience for the end users of HTML Tidy.
Definition
----------
HTACG HTML Tidy is a library and console application, and the release process is intended to officially designate a point of stability, where "stability" is ABI and API stability. "Stability" is represented by an even minor version number, and "released" means the HTACG has published and made available an even minor version number version of HTML Tidy.
Due to the number of platforms and language bindings which have adopted HTML Tidy, we are highly dependent on package managers to track the latest release versions of HTML Tidy, and release it on these other platforms. We cannot maintain distributions and language bindings for your favorite operating system or language package manager.
Release Process Overview
------------------------
The release process consists largely of the following steps:
### Lead up:
- Create the next release milestone on Github if not already done.
- Decide on PR's to include in the release, bumping version.txt, accordingly.
- Decide on any show-stopper outstanding issues, and action them.
- Change milestone of all excluded-this-time issues to the next milestone, or to indefinite.
- Decide target date for release.
### Release:
- Update the version number to the next release version, e.g., from 5.5.xx to 5.6.0.
- Generate a change log.
- Push this change to `next`.
- Merge this branch to `master`.
- Tag the release on `master`.
- Update the version number of the `next` branch to the next development version, e.g., from 5.8.0 to 5.9.0. At this point, both versions are identical except for the version number.
- Generate the API documentation for `next`.
- Generate the API documentation for `master`.
- Update the https://api.html-tidy.org/ website with the new API documentation.
- Update the https://www.html-tidy.org/ website with the new release version.
- Update the https://binaries.html-tidy.org/ website.
- Push all of the changes.
- Build binaries.
- Create a Github release per the Git tag created above.
- Post the binaries in the release.
Release Steps in Detail
--------------------------
### Update the version number to the next release version
In the `next` branch, modify the `version.txt` file to the next release version, for example, 5.8.0, and set the date.
### Generate a change log
If necessary, install the `github_changelog_generator`. This requires that you have a Ruby environment on your computer, which you probably do because the regression tests require it.
~~~
gem install github_changelog_generator
~~~
Youll also need a Github personal access token in order for the tool to pull information from Github. You can acquire one [here](https://github.com/settings/tokens).
Generate the change log like so:
~~~
github_changelog_generator -u htacg -p tidy-html5 \
--token [github_access_token] \
--since-tag 5.6.0 \
--usernames-as-github-logins \
--future-release 5.8.0 \
-o README/CHANGELOG.md
~~~
**Important**: the `--since-tag` value should be the git tag of the previous release, because we're only interested in the changes since then. The `--future-release` value should be the git tag that you _will apply_ (but have not yet) for this release.
### Commit this change to `next`
~~~
git add .
git commit -m 'Releasing HTML Tidy 5.8.0'
~~~
### Merge this branch to `master`
~~~
git checkout master
git merge next
~~~
### Tag the release on `master`
~~~
git tag -a 5.8.0 -m "HTML Tidy version 5.8.0"
~~~
### Update the version number of the `next` branch
For example, from from 5.8.0 to 5.9.0. At this point, both versions are identical except for the version number. Edit the `version.txt` file to make this change, and then
commit it to the repository.
### Generate the API documentation for `next`
First, build the `next` binary in `build/cmake`, so that API documentation tools have a correct version of HTML Tidy to work with. Perform a `git clean -xdf` in this directory prior to building for good measure.
After building, `cd` to the correct directory and build the documentation:
~~~
cd html-tidy.org.api/tidy-html5-doxygen
./build_docs.sh
~~~
Then in the `html-tidy.org.api/tidy-html5-doxygen/output` directory, rename the resulting directory and file to `tidylib_api_next/` and `quickref_next.html`, and move them into `html-tidy.org.api/tidy/`.
### Generate the API documentation for `master`
First, checkout `master` build the binary in `build/cmake`, so that API documentation tools have a correct version of HTML Tidy to work with. Perform a `git clean -xdf` in this directory prior to building for good measure.
After building, `cd` to the correct directory and build the documentation:
~~~
cd html-tidy.org.api/tidy-html5-doxygen
./build_docs.sh
~~~
Move the resulting directory and file into `html-tidy.org.api/tidy/` directly.
### Update the https://api.html-tidy.org/ website with the new API documentation
Check the copyright dates in `_includes/footer.md`.
~~~
cd html-tidy.org.api/
git add .
git commit -m "Added API documentation for master and next."
git push
~~~
### Update the https://www.html-tidy.org/ website with the new release version
Check the copyright dates in `_includes/footer.md`.
Update `html-tidy.org/homepage/_posts/1970-01-01-htmltidy.md` for the current release version and release year.
~~~
cd html-tidy.org/
git add .
git commit -m "Added API documentation for master and next."
git push
~~~
### Push all of the changes
Back in `tidy-html5/`
~~~
git checkout master
git push
git push origin <tag_name>
git checkout next
git push
~~~
### Build binaries
This is OS specific.
### Create a Github release per the Git tag created above
Do this on Github.
### Post the binaries in the release
Post the binaries here.
### Update the https://binaries.html-tidy.org/ website
Modify the files to point to the binaries in the Github releases.

19
README/TAGS.md Normal file
View File

@ -0,0 +1,19 @@
# Tidy HTML Elements
This is about adding a new HTML **tag**.
Tidy tries to support all **tags** supported by the W3C. To add a new supported **tag**, the definition begins in `tidyenum.h`, to give it a value. Then it is added to the `tag_defs[]` table in `tags.c`, where it is given a unique string, supported html versions, attributes support, and a bit `type`.
Note, there are a group of configuration options to add **tags** not yet approved by the W3C. These are [new-blocklevel-tags](https://api.html-tidy.org/tidy/quickref_next.html#new-blocklevel-tags), [new-empty-tags](https://api.html-tidy.org/tidy/quickref_next.html#new-empty-tags), [new-inline-tags](https://api.html-tidy.org/tidy/quickref_next.html#new-inline-tags). and [new-pre-tags](https://api.html-tidy.org/tidy/quickref_next.html#new-pre-tags). This provides a way to extend the `tag_defs[]` table just for that tidy session.
So, adding a new HTML **tag** consists of the following simple steps:
1. `tidyenum.h` - Give the element an internal name, like `TidyTag_XXXX`, and thus a value. Please keep this list in alphabetical order.
2. `tags.c` - Add a line to the `tag_defs[]` table. This assigns the unique string value of the element. Then the html versions that support the element, a pointer to the attributes supported by that elelment, and a bit field of the elements characteristics, inline, block, etc.
So, just changing 2 files, `tidyenum.h` and `tags.c`, and libTidy will now support that element, tag, as W3C approved. Simple... And at times, there is some case for adding **tags** that are still in the `Working Draft` stage, especially when there has been wide spread support in the community, even before it reaches `REC` stage.
Now, one could argue that this is not the **best** way to verify every attribute and value, for every tag, but that is a moot point - that is how tidy does it!
; eof 20170205

72
README/TESTING.md Normal file
View File

@ -0,0 +1,72 @@
# Testing
Its critical that changes you introduce do not cause regressions, i.e., that
Tidys output remains consistent with the introduction of your changes, except
for very specific circumstances.
Additionally, changes that you introduce to Tidy must usually be accompanied by
one or more test cases demonstrating the new feature or changed behavior.
Both of these concerns can be addressed with the Tidy repositorys automated
regression testing features, which are enabled by Github Actions. Any pull
request you make will automatically test your PR against the existing set of
test cases, and any failures are prima facie grounds for rejecting the PR.
You _must_ test your changes locally using the tools and test cases provided in
the `regression_testing/` directory prior to submitting a PR, including adding
test cases to this directory as needed.
## Changes to Existing Output
If your changes affect existing output, its critical to understand _why_, and
if necessary, regenerate the `-expects` files so that the regression testing
tool will pass with your new changes. These `-expects` changes, of course,
become part of your Pull Request, and will be subject to review and conversation
in the Pull Request thread.
If you do cause such regressions, please be prepared to defend why they are
needed.
## New Tests
If youre adding new features to Tidy, code reviewers need to be able to see the
intended effect of your changes via some type of demonstration. As such, please
write at least one test case in `github-cases` and put the expected results in
`github-expects`. These also constitute a part of your Pull Request, and more
importantly, will become part of the standard regression testing suite once the
PR is merged.
Try to keep your test case(s) as succinct as possible, and do try to put some HTML
comments in the file explaining the purpose of the test case, and if applicable,
the Github issue and/or PR number.
Note that the files generated in `github-results` for your new test cases are
suitable for use in `github-expects` when you are satisfied with the results.
A sample `case-123a@0.html` might represent issue #123, test **a** in a series
of multiple tests for this issue number, expecting Tidy exit code 0, and might
look something like this:
```
<!DOCTYPE html>
<html>
<!--
This test case represents HTML Tidy issue #123, and demonstrates
the use of new feature #xxx. Tidy should exit with status code 0.
The reason this change is needed is because WHATWG suddently
determined that a standards change #yyyy impacts us because of zzz.
-->
<head>
<title>Case #123a</title>
</head>
<p>The quick brown fox jumps over the lazy dog.<//p>
<body>
</body>
</html>
```
## Regression Testing Specifics
The regression testing mechanism is described more fully in [regression_testing/README.md](../regression_testing/README.md).

103
README/VERSION.md Normal file
View File

@ -0,0 +1,103 @@
# HTML Tidy Versioning
This document provides an explanation of how to interpret HTML Tidys version number, e.g. from command line output as a result of `tidy -v`, and also addresses the role of the file `version.txt` in Tidys build process.
## Background
**HTML Tidy** uses a modified version of [Semantic Versioning](https://semver.org/), and so its important to understand what the version number of **HTML Tidy** means to you, and how it might impact your workflow.
When you execute `tidy -v` on the command line, you might see responses such as:
~~~
HTML Tidy for Mac OS X version 5.1.24
HTML Tidy for Mac OS X version 5.2.0
HTML Tidy for Mac OS X version 5.3.15
HTML Tidy for Mac OS X version 5.4.0
HTML Tidy for Mac OS X version 5.5.1
~~~
_Obviously_ 5.5.1 is higher than 5.2.0, right? This might lead you to consider replacing your stable installations of **HTML Tidy** 5.2.0 across the board in your production process, but this might lead you to trouble. A little word about the meaning of our version numbers might help clear things up.
## Major, Minor, Patch
### Major
When HTACG assumed responsibility of **HTML Tidy** from previous maintainers, we immediately declared that the first release would be version 5.0, in honor of finally being able to offer modern HTML5 support.
Barring some major, monumental, massive change to Tidy, or the [release of HTML6](https://blog.whatwg.org/html-is-the-new-html5), **HTML Tidy** will probably be major version 5 forever. Maybe future maintainers will want to be trendy and release **HTML Tidy 2025**, but thats for them to decide.
### Minor
The minor version tells a lot more about the true version of Tidy that you have, but even so its not a simple matter that 5 > 2 and must be better. The minor number indicates **HTML Tidy** _release versions_ or _development versions_.
- **even numbered minor versions** indicate released versions of **HTML Tidy**. We provide binaries for releases, API documentation, and full support including cherry picking bug fixes back to them. In standard parlance, _released_ versions are _stable_ versions, meaning that the API is stable and you can generally expect Tidys output to be the same (other than as a result of bug fixes).
- **odd numbered minor versions** are development versions, or as is considered in many contexts _bleeding edge_ or _next_ versions. HTACG do not provide binaries, and API documentation is not usually up to date, but you do have access to the latest bug fixes, newest features, and knowledge of where Tidy is going. The downside, though, is that we make absolutely no guarantees that:
- Output remains the same as in previous release versions.
- Output remains the same as in earlier patch versions in the same development series.
- Configuration options may be added.
- Configuration options may be deleted.
- Parts of the C API may be added or deleted without warning.
- In short, development versions are bleeding edge and likely to be unstable (in the API sense -- we try never commit code that will crash).
### Patch
The patch indicates the latest version of the current minor version number. As with minor version numbers, there is some variation in their meaning:
- **patches for even numbered minor versions** indicate whether the latest supported update for that released version. In general, we hope that the patch number remains at 0 forever, e.g., 5.2.0. However if we do backport one or more bug fixes, you might see, e.g., 5.2.1.
- **patches for odd numbered minor versions** indicate our progress in committing code that changes some aspect of **HTML Tidy**s operation, such as the output it generates or a bug fix. Because **git** offers robust commit logging of its own, we won't generally bump the patch number for things such as documenting code, converting tabs to space, or even simplifying some piece of logic. Youll see that lots of good things are happening if the patch number is really large, e.g., 5.7.289!
## Development
### The `version.txt` File
The **libTidy** version is controlled by the contents of `version.txt` in the root.
This file consists of two lines of dot (.) separated items. The first being the **major**, **minor**, and **patch** version values, and the second string is a date. Example:
~~~
5.3.15
2017.01.29
~~~
When **CMake** is run, this file is read and two macros are added to the compile flags:
~~~
add_definitions ( -DLIBTIDY_VERSION="${LIBTIDY_VERSION}" )
add_definitions ( -DRELEASE_DATE="${tidy_YEAR}/${tidy_MONTH}/${tidy_DAY}" )
~~~
And in `CMakeLists.txt` there is the possibility to define another macro, when and if required:
~~~
# add_definitions ( -DRC_NUMBER="D231" )
~~~
These macros are put in `static const char` strings in **libTidys**s internal- only `src/version.h` file:
~~~
static const char TY_(release_date)[] = RELEASE_DATE;
#ifdef RC_NUMBER
static const char TY_(library_version)[] = LIBTIDY_VERSION "." RC_NUMBER;
#else
static const char TY_(library_version)[] = LIBTIDY_VERSION;
#endif
~~~
These strings are returned respectively by the **libTidy** API functions:
~~~
TIDY_EXPORT ctmbstr TIDY_CALL tidyLibraryVersion(void);
TIDY_EXPORT ctmbstr TIDY_CALL tidyReleaseDate(void);
~~~
### Git branches
Starting with HTML Tidy 5.4.0 release, our branching scheme aligns nicely with our version numbering scheme. Please consult [BRANCHES.md](BRANCHES.md).
Updated: 20170210
Date: 20150904

View File

@ -29,4 +29,9 @@ _CPack_Packages/*
*.wixobj
tidy
libtidy*
tidy1.xsl
tidy.pc
*.vcproj
.pkg
Info.plist
*.pkg

89
build/cmake/build-api.sh Executable file
View File

@ -0,0 +1,89 @@
#!/bin/sh
#< build-api.sh - 20151020 - build the API documentation for publishing...
BN=`basename $0`
TMPSRC="../.."
TMPFIL="$TMPSRC/version.txt"
if [ ! -f "$TMPFIL" ]; then
echo "Can NOT locate $TMPFIL! *** FIX ME ***"
exit 1
fi
echo "$BN: Read file $TMPFIL"
ls -l $TMPFIL
TMPCNT=0
while read LINE; do
if [ "$TMPCNT" = "0" ]; then
TMPVER="$LINE"
fi
TMPCNT=`expr $TMPCNT + 1`
done <$TMPFIL
#TMPVER=$(<$TMPFIL)
#TMPVER=$(cat $TMPFIL)
echo "$BN: Version $TMPVER"
TMPZIP="tidylib_api-$TMPVER.zip"
ask()
{
pause
if [ ! "$?" = "0" ]; then
exit 1
fi
}
TMPDIR="../../documentation/temp"
TMPZFIL="../../documentation/$TMPZIP"
if [ -f "$TMPZFIL" ]; then
ls -l $TMPZFIL
echo "$BN: WARNING: Current ZIP will be overwritten!"
echo "$BN: DO you want to continue?"
ask
fi
TMPFIL="build-me.sh"
if [ ! -x "$TMPFIL" ]; then
echo "$BN: Can NOT locate '$TMPFIL'! *** FIX ME ***"
echo "$BN: This is a simple build script, that accepts parameters..."
exit 1
fi
if [ -d "$TMPDIR" ]; then
echo "$BN: Directory '$TMPDIR' will be deleted prior the documentation build..."
fi
./$TMPFIL -DBUILD_DOCUMENTATION:BOOL=YES
if [ ! "$?" = "0" ]; then
echo "$BN: The running of $TMPFIL failed! ????"
exit 1
fi
if [ -d "$TMPDIR" ]; then
echo "$BN: Deleting '$TMPDIR'..."
cd $TMPDIR
rm -rf *
cd -
fi
echo "$BN: Doing 'make documentation'..."
make documentation
if [ -d "$TMPDIR" ]; then
echo "$BN: Generated a new '$TMPDIR'..."
if [ -f "$TMPZFIL" ]; then
rm -fv $TMPZFIL
fi
cd $TMPDIR
echo "$BN: Generating ../$TMPZIP..."
zip -r ../$TMPZIP * >/dev/null
ls -l ../$TMPZIP
cd -
else
echo "$BN: WARNING '$TMPDIR' not generated!"
exit 1
fi
exit 0
# eof

View File

@ -1,3 +1,16 @@
@setlocal
@set TMPLOG=bldlog-p.txt
cmake --build . --config Release --target PACKAGE
@echo Running: 'cmake --build . --config Release --target PACKAGE' out to %TMPLOG%
@echo Running: 'cmake --build . --config Release --target PACKAGE' > %TMPLOG%
cmake --build . --config Release --target PACKAGE >> %TMPLOG%
@if ERRORLEVEL 1 goto ISERR
@echo Build package done... see %TMPLOG%
@endlocal
@exit /b 0
:ISERR
@endlocal
@exit /b 1
@REM eof

View File

@ -1,27 +1,37 @@
@setlocal
@set TMPVER=1
@set TMPPRJ=tidy5
@set TMPPRJ=tidy
@set TMPSRC=..\..
@set TMPBGN=%TIME%
@set TMPINS=..\..\..\software
@set DOTINST=0
@set TMPINS=D:\Projects\3rdParty
@set TMPLOG=bldlog-1.txt
@set DOPAUSE=1
@set TMPGEN=Visual Studio 16 2019
@set TMPBR=next
@set TMPINDBG=0
@set TMPOPTS=-DCMAKE_INSTALL_PREFIX=%TMPINS%
@set TMPOPTS=-G "%TMPGEN%" -A Win32
@set TMPOPTS=%TMPOPTS% -DCMAKE_INSTALL_PREFIX=%TMPINS%
@set TMPOPTS=%TMPOPTS% -DBUILD_SHARED_LIB=ON
:RPT
@if "%~1x" == "x" goto GOTCMD
@set TMPOPTS=%TMPOPTS% %1
@if "%~1x" == "NOPAUSEx" (
@set DOPAUSE=0
) else (
@set TMPOPTS=%TMPOPTS% %1
)
@shift
@goto RPT
:GOTCMD
@call chkmsvc %TMPPRJ%
@call chkbranch master
@if "%TMPBR%x" == "x" goto DNBR
@call chkbranch %TMPBR%
:DNBR
@echo Build %DATE% %TIME% > %TMPLOG%
@echo Build %TMPPRJ% 32-bits %DATE% %TIME%, in %CD%, to %TMPLOG% > %TMPLOG%
@if NOT EXIST %TMPSRC%\nul goto NOSRC
@ -34,51 +44,70 @@
@if NOT EXIST %TMPSRC%\CMakeLists.txt goto NOCM
cmake %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1
@echo Doing: 'cmake %TMPSRC% %TMPOPTS%'
@echo Doing: 'cmake %TMPSRC% %TMPOPTS%' >> %TMPLOG% 2>&1
@cmake %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR1
cmake --build . --config Debug >> %TMPLOG% 2>&1
@echo Doing: 'cmake --build . --config Debug'
@echo Doing: 'cmake --build . --config Debug' >> %TMPLOG% 2>&1
@cmake --build . --config Debug >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR2
cmake --build . --config Release >> %TMPLOG% 2>&1
@echo Doing: 'cmake --build . --config Release'
@echo Doing: 'cmake --build . --config Release' >> %TMPLOG% 2>&1
@cmake --build . --config Release >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR3
@fa4 "***" %TMPLOG%
@call elapsed %TMPBGN%
@echo Appears a successful build... see %TMPLOG%
@if "%DOTINST%x" == "0x" goto DNTINST
@echo Building installation zips... moment...
@call build-zips Debug
@call build-zips Release
@echo Done installation zips...
:DNTINST
@echo Note install location %TMPINS%
@if "%TMPINDBG%x" == "1x" (
@echo Will install Debug and Release
) else {
@echo Will only install Release
)
@echo.
@REM echo No install at this time, but there is a updexe.bat to copy the EXE to c:\MDOS...
@REM goto END
@echo Continue with install? Only Ctrl+c aborts...
@REM ##############################################
@REM Check if should continue with install
@REM ##############################################
@if "%DOPAUSE%x" == "0x" goto DOINST
@choice /? >nul 2>&1
@if ERRORLEVEL 1 goto NOCHOICE
@choice /D N /T 10 /M "Pausing for 10 seconds. Def=N"
@if ERRORLEVEL 2 goto GOTNO
@goto DOINST
:NOCHOICE
@echo Appears OS does not have the 'choice' command!
@ask *** CONTINUE with install? *** Only y continues
@if ERRORLEVEL 2 goto NOASK
@if ERRORLEVEL 1 goto DOINST
@echo Skipping install to %TMPINST% at this time...
@echo.
@goto END
:NOASK
@echo 'ask' utility not found in path...
@echo.
@echo *** CONTINUE with install? *** Only Ctrl+c aborts...
@echo.
@pause
cmake --build . --config Debug --target INSTALL >> %TMPLOG% 2>&1
:DOINST
@echo Proceeding with INSTALL...
@echo.
@if NOT "%TMPINDBG%x" == "1x" goto DNDBGIN
@echo Doing: 'cmake --build . --config Debug --target INSTALL'
@echo Doing: 'cmake --build . --config Debug --target INSTALL' >> %TMPLOG% 2>&1
@cmake --build . --config Debug --target INSTALL >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR4
@REM if EXIST install_manifest.txt (
@REM copy install_manifest.txt install_manifest_dbg.txt >nul
@REM echo. >> %TMPINS%/installed.txt
@REM echo = %TMPRJ% Debug install %DATE% %TIME% >> %TMPINS%/installed.txt
@REM type install_manifest.txt >> %TMPINS%/installed.txt
@REM )
:DNDBGIN
cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1
@echo Doing: 'cmake --build . --config Release --target INSTALL'
@echo Doing: 'cmake --build . --config Release --target INSTALL' >> %TMPLOG% 2>&1
@cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR5
@REM if EXIST install_manifest.txt (
@REM copy install_manifest.txt install_manifest_rel.txt >nul
@REM echo. >> %TMPINS%/installed.txt
@REM echo = %TMPRJ% Release install %DATE% %TIME% >> %TMPINS%/installed.txt
@REM type install_manifest.txt >> %TMPINS%/installed.txt
@REM )
@fa4 " -- " %TMPLOG%
@ -87,6 +116,12 @@ cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1
@goto END
:GOTNO
@echo.
@echo No install at this time, but there may be an updexe.bat to copy the EXE to c:\MDOS...
@echo.
@goto END
:NOSRC
@echo Can NOT locate source %TMPSRC%! *** FIX ME ***
@echo Can NOT locate source %TMPSRC%! *** FIX ME *** >> %TMPLOG%

25
build/cmake/cmake-clean.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
#< cmake-clean.sh for tidy - remove tidylib...
FILES="libtidy*"
TMPCNT=0
for f in $FILES; do
TMPCNT=`expr $TMPCNT + 1`
echo "$TMPCNT: File $f"
done
echo "Will delete the above $TMPCNT files ater a 5 seconds sleep!"
sleep 5
echo "Deleting the above $TMPCNT files!"
for f in $FILES; do
rm -fv $f
done
echo "all done..."
# eof

View File

@ -26,4 +26,5 @@ libtidy.so.5
libtidy.so.5.0.0
tidy.1
_CPack_Packages
tidy1.xsl
tidy.pc

139
build/cmake/gen-html.sh Executable file
View File

@ -0,0 +1,139 @@
#!/bin/sh
#< gen-html.sh 2021/03/26, from gen-html.bat
BN=`basename $0`
ask()
{
pause
if [ ! "$?" = "0" ]; then
exit 1
fi
}
# @REM Build HTML from log of 'version.txt'
# @REM Versify the tools used
echo "$BN: Doing: 'verhist.pl -? >/dev/null'"
verhist.pl -? >/dev/null
if [ ! "$?" = "0" ]; then
echo "Unable to run 'verhist.pl'! *** FIX ME ***"
exit 1
fi
echo "$BN: Doing: 'emailobfuscate.pl -? >/dev/null'"
emailobfuscate.pl -? >/dev/null
if [ ! "$?" = "0" ]; then
echo "Unable to run 'emailobfuscate.pl'! *** FIX ME ***"
exit 1
fi
TMPFIL1="../../version.txt"
if [ ! -f "$TMPFIL1" ]; then
echo "Can NOT locate $TMPFIL1, in $(pwd) - *** FIX ME ***"
exit 1
fi
echo "$BN: Doing: 'dirmin $TMPFIL1'"
ls -l "$TMPFIL1"
# TMPVER=$(cat $TMPFIL1)
TMPCNT=0
while read -r a; do
TMPCNT=`expr $TMPCNT + 1`;
if [ ! -z "$a" ]; then
echo "$TMPCNT: '$a'"
if [ "$TMPCNT" = "1" ]; then
export TMPVER="$a";
fi
break;
fi
done < $TMPFIL1
echo "Current version '$TMPVER' ..."
TMPLOG1="../../../temp-$TMPVER.log"
TMPLOG2="../../../temp2-$TMPVER.log"
TMPLOG3="../../../temp3-$TMPVER.log"
if [ ! -f "$TMPLOG1" ]; then
echo "$BN: Doing: 'git log -p $TMPFIL1 > $TMPLOG1'"
git log -p $TMPFIL1 > $TMPLOG1
if [ ! -f "$TMPLOG1" ]; then
echo "Gen of $TMPLOG1 FAILED! *** FIX ME ***"
exit 1
fi
fi
echo "$BN: Got log 1 '$TMPLOG1' ..."
ls -l "$TMPLOG1"
if [ ! -f "$TMPLOG2" ]; then
echo "$BN: Doing: 'verhist.pl $TMPLOG1 -o $TMPLOG2'"
verhist.pl $TMPLOG1 -o $TMPLOG2
if [ ! -f "$TMPLOG2" ]; then
echo "Gen of $TMPLOG2 FAILED! *** FIX ME ***"
exit 1
fi
fi
echo "$BN: Got log 2 '$TMPLOG2' ..."
ls -l $TMPLOG2
TMPV="$1"
if [ -z "$TMPV" ]; then
echo "Give the cut-off version, like 5.6.0, to continue.."
exit 1
fi
echo "$BN: Doing: 'grep $TMPV $TMPLOG2'"
grep $TMPV $TMPLOG2
if [ ! "$?" = "0" ]; then
echo "Failed to find '$TMPV'... check the file '$TMPLOG2'"
exit 1
fi
TMPD="$2"
if [ -z "$TMPD" ]; then
echo "Give the DATE of the cut-off, like 'Sat Nov 25 14:50:00 2017 +0100', to continue..."
exit 1
fi
if [ ! -f "$TMPLOG3" ]; then
echo "$BN: Doing: 'git log "--decorate=full" "--since=$TMPD" > $TMPLOG3'"
git log "--decorate=full" "--since=$TMPD" > $TMPLOG3
if [ ! -f "$TMPLOG3" ]; then
echo "Failed to generate 'git log ...' - *** FIX ME ***"
exit 1
fi
fi
echo "$BN: Got log 3 '$TMPLOG3' ..."
ls -l "$TMPLOG3"
# @REM at last generate the release HTML
TMPHTM="../../../temp-$TMPVER.html"
if [ ! -f "$TMPHTM" ]; then
echo "$BN: Doing: 'emailobfuscate.pl $TMPLOG3 -o $TMPHTM -a $TMPVER -i'"
emailobfuscate.pl $TMPLOG3 -o $TMPHTM -a $TMPVER -i
if [ ! -f "$TMPHTM" ]; then
echo "FAILED to generate $TMPHTM! *** FIX ME ***"
exit 1
fi
fi
echo "$BN: Got HTML file '$TMPHTM' ..."
ls -l "$TMPHTM"
echo "$BN: Generation appears ok, check file '$TMPHTM' in browser..."
### start $TMPHTM
TMPVFIL="../../README/verhist.log"
if [ ! -f "$TMPVFIL" ]; then
echo ""
echo "$BN: *** WARNING *** - Missing existing '$TMPVFIL'"
echo ""
fi
echo ""
echo "$BN: Is all OK, final actions, for release are -"
echo "copy $TMPLOG2 to $TMPVFIL - push this to repo..."
echo "copy $TMPHTM to the binaries repo..."
echo ""
# @REM eof

View File

@ -2,16 +2,12 @@
@set TMPWV=win32
@set TMPSRC=../..
@set TMPNAME=tidy
@set TMPFIL=%TMPSRC%\version.txt
@if NOT EXIST %TMPFIL% goto NOFIL
@set /p TMPVER=<%TMPFIL%
@set DOPAUSE=pause
@echo Version %TMPVER%
if "%1x" == "NOPAUSEx" (
set DOPAUSE=echo No pause requested...
)
@echo Version %TMPVER%
@set TMPBIN=F:\Projects\tidy-bins
@set TMPBINS=%TMPBIN%\binaries
@ -22,17 +18,30 @@ if "%1x" == "NOPAUSEx" (
@echo This is a NEW installation in %TMPDD%
:GOTDST
@if "%1x" == "NOPAUSEx" (
@set DOPAUSE=echo No pause requested...
)
@echo Will publish...
@set TMPCNT=0
@set TMPFIL1=%TMPNAME%-%TMPVER%-%TMPWV%.exe
@set TMPFIL2=%TMPNAME%-%TMPVER%-%TMPWV%.msi
@set TMPFIL3=%TMPNAME%-%TMPVER%-%TMPWV%.zip
@if NOT EXIST %TMPFIL1% goto NOFIL1
@if NOT EXIST %TMPFIL2% goto NOFIL2
@if NOT EXIST %TMPFIL3% goto NOFIL3
@echo.
@echo Will publish...
@if EXIST %TMPFIL1% (
@echo %TMPFIL1%
@set /A TMPCNT+=1
)
@if EXIST %TMPFIL2% (
@echo %TMPFIL2%
@set /A TMPCNT+=1
)
@if EXIST %TMPFIL3% (
@echo %TMPFIL3%
@set /A TMPCNT+=1
)
@if "%TMPCNT%x" == "0x" goto NOPUB
@echo.
@echo Will publish %TMPCNT% files to %TMPDD%
@echo.
@echo *** CONTINUE?%
@%DOPAUSE%
@ -42,18 +51,25 @@ if "%1x" == "NOPAUSEx" (
@if NOT EXIST %TMPDD%\nul goto NODST
)
@if EXIST %TMPFIL1% (
@set TMPSRC=%TMPFIL1%
@set TMPDST=%TMPDD%\%TMPFIL1%
@call :CHKCOPY
)
@if EXIST %TMPFIL2% (
@set TMPSRC=%TMPFIL2%
@set TMPDST=%TMPDD%\%TMPFIL2%
@call :CHKCOPY
)
@if EXIST %TMPFIL3% (
@set TMPSRC=%TMPFIL3%
@set TMPDST=%TMPDD%\%TMPFIL3%
@call :CHKCOPY
)
@echo.
@echo Maybe time to run 'gentidyyml %TMPBIN%'
@echo If done all bins, WIN32, WIN64, linux, ... maybe time to run 'gentidyyml %TMPBIN%'
@echo.
@goto END
@ -85,26 +101,20 @@ copy %TMPSRC% %TMPDST%
@echo.
@goto :EOF
:NODST
@echo Error: Unable to create %TMPDD%
@goto END
:NOPUB
@echo Appears no files to PUBLISH!
:NOFIL1
@echo Can NOT locate %TMPFIL1%! *** FIX ME ***
@goto CHKBB
:NOFIL2
@echo Can NOT locate %TMPFIL2%! *** FIX ME ***
@goto CHKBB
:NOFIL3
@echo Can NOT locate %TMPFIL3%! *** FIX ME ***
@goto CHKBB
:CHKBB
@echo.
@echo Have you run build-bins.bat?
@echo.
@goto END

View File

@ -11,11 +11,15 @@ fi
echo "$BN: Read file $TMPFIL"
ls -l $TMPFIL
# while read LINE; do
# TMPVER="$LINE"
#done <$TMPFIL
TMPCNT=0
while read LINE; do
if [ "$TMPCNT" = "0" ]; then
TMPVER="$LINE"
fi
TMPCNT=`expr $TMPCNT + 1`
done <$TMPFIL
#TMPVER=$(<$TMPFIL)
TMPVER=$(cat $TMPFIL)
#TMPVER=$(cat $TMPFIL)
echo "$BN: Version $TMPVER"
@ -28,20 +32,22 @@ ask()
}
TMPBIN="$HOME/projects/html_tidy/tidy-bin"
TMPBIN="$HOME/projects/html_tidy/binaries"
TMPBINS="$TMPBIN/binaries"
if [ ! -d "$TMPBINS" ]; then
echo "$BN: Can NOT location '$TMPBINS'! *** FIX ME ***"
exit 1
fi
TMPDD="$TMPBINS/tidy-$TMPVER"
if [ ! -d "$TMPDD" ]; then
echo ""
if [ -d "$TMPDD" ]; then
echo "$BN: Destination is $TMPDD"
else
echo "$BN: This is a NEW installation in $TMPDD"
fi
TMPFIL1="tidy5-$TMPVER-$TMPWV.deb"
TMPFIL2="tidy5-$TMPVER-$TMPWV.rpm"
TMPFIL1="tidy-$TMPVER-$TMPWV.deb"
TMPFIL2="tidy-$TMPVER-$TMPWV.rpm"
if [ ! -f "$TMPFIL1" ]; then
echo "$BN: $TMPFIL1 does not exits"
echo "$BN: Have you run '[sudo] make package'?"
@ -56,6 +62,11 @@ echo ""
echo "$BN: Will publish..."
echo "$TMPFIL1"
echo "$TMPFIL2"
if [ ! -d "$TMPDD" ]; then
echo "$BN: Will create dir $TMPDD"
else
echo "$BN: Destination $TMPDD"
fi
echo ""
echo "$BN: *** CONTINUE? ***"
ask

39
build/cmake/rentidy.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
#< rentidy.sh - 20160201
BN=`basename $0`
ask()
{
pause
if [ ! "$?" = "0" ]; then
exit 1
fi
}
TMPEXE="/usr/bin/tidy"
if [ ! -f "$TMPEXE" ]; then
echo "$BN: Can not locate '$TMPEXE'"
exit 1
fi
# tidy -v
$TMPEXE -v
if [ ! "$?" = "0" ]; then
echo "$BN: Can not run $TMPEXE!"
exit 1
fi
TMPVER=`$TMPEXE -v | awk '{ print $6 }'`
# echo "$BN: Version $TMPVER"
TMPFIL2="$TMPEXE-$TMPVER"
if [ -f "$TMPFIL2" ]; then
echo "$BN: New name already exists!"
exit 1
fi
echo "$BN: Rename $TMPEXE to $TMPFIL2?"
ask
sudo mv $TMPEXE $TMPFIL2
# eof

View File

@ -1,8 +1,8 @@
@setlocal
@REM copy the EXE into C:\MDOS, IFF changed
@set TMPDIR=C:\MDOS
@set TMPFIL1=tidy5.exe
@set TMPFIL2=tidy5-32.exe
@set TMPFIL1=tidy.exe
@set TMPFIL2=tidy32.exe
@set TMPSRC=Release\%TMPFIL1%
@if NOT EXIST %TMPSRC% goto ERR1
@echo Current source %TMPSRC%

View File

@ -1,12 +0,0 @@
# file created during build_docs
# = tidy5 -h > tidy5.cmd.txt
examples/tidy5.*.txt
# The license file needs to copies to examples for \include
examples/LICENSE.md
# file generates from xsl
examples/quickref_include.html

View File

@ -1,198 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.9.1 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title="Tidy Home"/>
<tab type="pages" visible="yes" title="Pages" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
<tab type="user" url="https://github.com/htacg/tidy-html5/issues" title="Bugs &amp; Issues"/>
<tab type="user" url="https://github.com/htacg/tidy-html5" title="github"/>
<tab type="user" url="http://www.htacg.org/" title="htacg.org"/>
<tab type="user" url="http://www.html-tidy.org/" title="html-tidy.org"/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -1,105 +0,0 @@
Documentation HOWTO {#docs_howto}
========================
Instructions for generating documentation
\note For linking to these docs, the doxygen tag file is `tidy.tags`
**HTML Tidy** provides several types of documentation to suit different purposes. This
document describes how to generate the following:
- `tidylib_api/` (directory)
- This collection of documents describes the **TidyLib** API and is generated from the
comments and code in the **Tidy** source code.
- `quickref.html`
- This document provides a nice, readable HTML document describing all of the options and
settings that you can use with **Tidy** and internally in **TidyLib**.
- `tidy.1`
- This document is a Mac/Linux/Unix standard `man` page.
## The easy way
In this directory you can find the shell script `build_docs.sh`, and that will build all
of the documentation into the `temp/` directory (i.e., `{tidy}/build/documentation/temp`).
Please note these prerequisites:
- It's a Mac/Linux/Unix shell script.
- Doxygen is required to generate the API documentation.
- xsltproc is required to generate the man page and the `quickref.html` file.
If you prefer to understand how to do this manually (for example, for integration into
other scripts, build systems, or IDEs), read on.
## Manually
### `tidylib_api/` (directory)
If you want to build the API documentation you must have [doxygen][1] installed.
You can clone the [repository from github][2] if it is not currently installed.
Building as simple as:
~~~
cd {tidy}/build/documentation/
doxygen doxygen.cfg
~~~
This will result in a document set in `{tidy}/build/documentation/temp/tidylib_api`,
where you can find the main `index.html` file.
### `quickref.html`
Note that these instructions require the standard `xsltproc` utility to build the file,
but any XSLT processor of your choice should work, too.
- `tidy -xml-config > "tidy-config.xml"`
- This uses your up-to-date version of **Tidy** to generate an XML file containing all
of **Tidy**s built-in settings and their descriptions. This file is only temporary,
as it will be transformed in the next step.
- `xsltproc "quickref.xsl" "tidy-config.xml" > "quickref.html"`
- This examples uses the `xsltproc` command to transform `tidy-config.xml` using the
rules in the `quickref.xsl` stylesheet, and output it to `quickref.html`.
### `tidy.1`
Note that these instructions require the standard `xsltproc` utility to build the file,
but any XSLT processor of your choice should work, too.
- `tidy -xml-config > "tidy-config.xml"`
- This uses your up-to-date version of **Tidy** to generate an XML file containing all
of **Tidy**s built-in settings and their descriptions. This file is only temporary,
as it will be transformed in the third step.
- `tidy -xml-help > "tidy-help.xml"`
- This uses your up-to-date version of **Tidy** to generate an XML file containing all
of **Tidy**s built-in help information. This file is only temporary,
as it will be transformed in the next step.
- `xsltproc "tidy1.xsl" "tidy-help.xml" > "tidy.1"`
- This examples uses the `xsltproc` command to transform `tidy-help.xml` using the
rules in the `tidy1.xsl` stylesheet, and output it to `tidy.1`.
\note Note that `tidy1.xls` includes the file `tidy-config.xml` as part of the stylesheet,
and so although it does not appear in the command invocation, it is indeed required.
[1]: http://www.stack.nl/~dimitri/doxygen/
[2]: https://github.com/doxygen/doxygen

View File

@ -1,152 +0,0 @@
#!/bin/sh
# See cat << HEREDOC for file description.
# Set this to the complete path of the tidy for which you want to generate
# documentation. Relative path is okay. You shouldn't have to change this
# too often if your compiler always puts tidy in the same place.
TIDY_PATH="../cmake/tidy5" # Current directory.
TIDY_VERSION=`cat ../../version.txt`
cat << HEREDOC
Build 'tidy.1', which is a man page suitable for installation
in all Unix-like operating systems. This script will build
it, but not install it.
Build 'quickref.html'. This is distributed with the
the Tidy source code and also used on Tidy's website.
Be sure to distribute it with 'quickref.css' as well.
Build the 'tidylib_api' directory, which contains a website
with the documentation for TidyLibs headers.
These files will be built into '{current_dir}/temp'.
HEREDOC
# Output and flags' declarations.
DOXY_CFG="doxygen.cfg"
OUTP_DIR="temp"
BUILD_XSLT=1
BUILD_API=1
##
# Ensure the output dir exists.
##
if [ ! -d "$OUTP_DIR" ]; then
mkdir $OUTP_DIR
fi
##
# Preflight
##
# Check for a valid tidy.
if [ ! -x "$TIDY_PATH" ]; then
BUILD_XSLT=0
echo "- '$TIDY_PATH' not found. You should set TIDY_PATH in this script."
fi
# Check for xsltproc dependency.
hash xsltproc 2>/dev/null || { echo "- xsltproc not found. You require an XSLT processor."; BUILD_XSLT=0; }
##
# Build 'quickref.html' and 'tidy.1'.
##
if [ "$BUILD_XSLT" -eq 1 ]; then
# Use the designated tidy to get its config and help.
# These temporary files will be cleaned up later.
$TIDY_PATH -xml-config > "tidy-config.xml"
$TIDY_PATH -xml-help > "tidy-help.xml"
# 'quickref.html'
xsltproc "quickref.xsl" "tidy-config.xml" > "$OUTP_DIR/quickref.html"
xsltproc "quickref.include.xsl" "tidy-config.xml" > ./examples/quickref_include.html
# 'tidy.1'
xsltproc "tidy1.xsl" "tidy-help.xml" > "$OUTP_DIR/tidy.1"
# Cleanup - Note: to avoid issues with the tidy1.xsl finding the tidy-config.xml
# document, they are created and read from the source directory instead of temp.
rm "tidy-config.xml"
rm "tidy-help.xml"
echo "'quickref.html' and 'tidy.1' have been built.\n"
else
echo "* tidy.1 was skipped because not all dependencies were satisfied."
fi
##
# Preflight
##
# Check for the doxygen.cfg file.
if [ ! -f "$DOXY_CFG" ]; then
BUILD_API=0
echo "- 'DOXY_CFG' not found. It is required to configure doxygen."
fi
# Check for doxygen dependency.
hash doxygen 2>/dev/null || { echo "- doxygen not found. This script requires doxygen."; BUILD_XSLT=0; }
##
# Build the doxygen project.
##
if [ "$BUILD_API" -eq 1 ]; then
echo "The following is doxygen's stderr output. It doesn't indicate errors with this script:\n"
# echo the output of tidy5 --help so we can include
$TIDY_PATH -h > "./examples/tidy5.help.txt"
$TIDY_PATH -help-config > "./examples/tidy5.config.txt"
## copy license file to examples for includsing
cp ../../LICENSE.md ./examples/
## this lot
# - echos and catches outputs the doxygen config
# - overwrites some vars but appending some to config an end
# - which are then passed to doxygen as stdin (instead of the path to a config.file)
( cat "$DOXY_CFG"; \
echo "PROJECT_NUMBER=$TIDY_VERSION"; \
echo "GENERATE_TAGFILE=$OUTP_DIR/tidylib_api/tidy.tags"; \
echo "HTML_EXTRA_FILES= ./examples/tidy5.help.txt ./examples/tidy5.config.txt"; ) \
| doxygen - > /dev/null
# cleanup
rm "./examples/tidy5.help.txt"
rm "./examples/tidy5.config.txt"
rm "./examples/LICENSE.md"
## create zip file of docs
cd $OUTP_DIR;
#zip -r "tidy-docs-$TIDY_VERSION.zip" ./tidylib_api
echo "\nTidyLib API documentation has been built."
else
echo "* $OUTP_DIR/tidylib_api/ was skipped because not all dependencies were satisfied."
fi
##
# Done
##
echo "\nDone.\n"

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +0,0 @@
#include <tidy.h>;
#include <buffio.h>;
#include <stdio.h>;
#include <errno.h>;
int main(int argc, char **argv )
{
const char* input = "<title>Hello</title><p>World!";
TidyBuffer output = {0};
TidyBuffer errbuf = {0};
int rc = -1;
Bool ok;
// Initialize "document"
TidyDoc tdoc = tidyCreate();
printf( "Tidying:\t%s\n", input );
// Convert to XHTML
ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes );
if ( ok )
rc = tidySetErrorBuffer( tdoc, &errbuf ); // Capture diagnostics
if ( rc >= 0 )
rc = tidyParseString( tdoc, input ); // Parse the input
if ( rc >= 0 )
rc = tidyCleanAndRepair( tdoc ); // Tidy it up!
if ( rc >= 0 )
rc = tidyRunDiagnostics( tdoc ); // Kvetch
if ( rc > 1 ) // If error, force output.
rc = ( tidyOptSetBool(tdoc, TidyForceOutput, yes) ? rc : -1 );
if ( rc >= 0 )
rc = tidySaveBuffer( tdoc, &output ); // Pretty Print
if ( rc >= 0 )
{
if ( rc > 0 )
printf( "\nDiagnostics:\n\n%s", errbuf.bp );
printf( "\nAnd here is the result:\n\n%s", output.bp );
}
else
printf( "A severe error (%d) occurred.\n", rc );
tidyBufFree( &output );
tidyBufFree( &errbuf );
tidyRelease( tdoc );
return rc;
}

View File

@ -1,22 +0,0 @@
// sample config file for HTML tidy
indent: auto
indent-spaces: 2
wrap: 72
markup: yes
output-xml: no
input-xml: no
show-warnings: yes
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: latin1
new-inline-tags: cfif, cfelse, math, mroot,
mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
munder, mover, mmultiscripts, msup, msub, mtext,
mprescripts, mtable, mtr, mtd, mth
new-blocklevel-tags: cfoutput, cfquery
new-empty-tags: cfelse

View File

@ -1,52 +0,0 @@
/*!
\mainpage Tidy home
\note The repository <a href="https://github.com/htacg/tidy-html5">github.com/htacg/tidy-html5</a> and this documentation should be considered canonical for HTML Tidy as of 2015-January-15. See \ref history
\b Tidy corrects and cleans up HTML content by fixing markup errors such as mismatched, misnested and missing tags, missing end "/" tags, missing quotations et all, eg:
\code{.html}
<h1><hr>heading</h1>
<h2>sub<hr>heading</h2>
<a href="#refs">References<a>
\endcode
is converted to
\code{.html}
<hr>
<h1>heading</h1>
<h2>sub</h2>
<hr>
<h2>heading</h2>
<a href="#refs">References</a>
\endcode
<h4>This project has two parts:</h4>
- \ref tidylib
- a C static or dynamic library that developers can integrate into their applications
in order to bring all of Tidys power to your favorite tools.
- \ref tidy_cmd
- a console application built on \ref tidylib for Mac OS X, Linux, Windows, UNIX, and more.
\section content Contents
- \ref quick_ref
- \ref tidy_cmd
- \ref tidy_quickstart
- \ref tidy_config
- \ref featured_options
- \ref tidy_scripting
- \ref tidylib
- <a href="modules.html">Modules</a>
- \ref building_tidy
-\ref docs_howto
- \subpage history
- \subpage license
- \ref todo
*/

View File

@ -1,98 +0,0 @@
/*!
\page building_tidy Building Tidy
How to compile and install Tidy from source code.
\tableofcontents
\section Prerequisites
- \b git - <a href="http://git-scm.com/book/en/v2/Getting-Started-Installing-Git">git-scm.com/book/en/v2/Getting-Started-Installing-Git</a>
- \b cmake - <a href="http://www.cmake.org/download/">cmake.org/download/</a>
- Appropriate build tools for the platform
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 the 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
variuous 'native' build files. Running cmake without any parameters will 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.
In windows cmake offers various versions of MSVC. Again below only the command line use of MSVC is shown, but the
tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building done in there.
\section get_source Get the source code
Tidys sourcecode can be found at <a href="https://github.com/htacg/tidy-html5">github.com/htacg/tidy-html5</a>. There are sometimes
several branches, but in general `master` is the most recently updated version.
\note Note that as “cutting edge,” it may have bugs or other
unstable behavior. If you prefer a stable, officially released version, be sure to have a look
at Releases on the github page.
In general you can use the <b>Download ZIP</b> button on the github page to download the most recent version of a branch. If you prefer
Git then you can clone the repository to a working machine with:
\code{.sh}
git clone git@github.com:htacg/tidy-html5.git
\endcode
\section compile Compile
<h4>Enter the `build/cmake` directory</h4>
\code{.sh}
# *nix
cd {your-tidy-html5-directory}/build/cmake
# windows
cd {your-tidy-html5-directory}\build\cmake
\endcode
<h4>Configure the build</h4>
\code{.sh}
# *nix
cmake ../../ [-DCMAKE_INSTALL_PREFIX=/path/for/install]
# windows
cmake ..\..\
\endcode
By default cmake sets the install path to `/usr/local` in unix.
If you wanted the binary in say `/usr/bin` instead, then use `-DCMAKE_INSTALL_PREFIX=/usr`
On windows the default install is to `C:\Program Files\tidy5`, or `C:/Program Files (x86)/tidy5`, which is not very useful. After
the build the `tidy[n].exe` is in the `Release\` directory, and can be copied to any directory in your `PATH` environment variable, for global use.
If you need the tidy library built as a 'shared' (DLL) library, then in add the command `-DBUILD_SHARED_LIB:BOOL=ON`.
This option is `OFF` by default, so the static library is built and linked with the command line tool for convenience.
<h4>Compile</h4>
\code{.sh}
# *nix
make
# windows
cmake --build . --config Release
\endcode
\section compileOnstall Install
Install the applicatio and library with
\code{.sh}
# *nix
[sudo] make install
# windows
cmake --build . --config Release --target INSTALL
\endcode
*/

View File

@ -1,146 +0,0 @@
/*!
\page featured_options Featured Options
Overview of popular features and problems
\tableofcontents
\section indenting Indenting output for readability
Indenting the source markup of an HTML document makes the markup easier to read. Tidy can indent the
markup for an HTML document while recognizing elements whose contents should not be indented. In the
example below, Tidy indents the output while preserving the formatting of the `<pre>` element:
Input:
\code{.html}
<html>
<head>
<title>Test document</title>
</head>
<body>
<p>This example shows how Tidy can indent output while preserving
formatting of particular elements.</p>
<pre>This is
<em>genuine
preformatted</em>
text
</pre>
</body>
</html>
\endcode
Output:
\code{.html}
<html>
<head>
<title>Test document</title>
</head>
<body>
<p>This example shows how Tidy can indent output while preserving
formatting of particular elements.</p>
<pre>
This is
<em>genuine
preformatted</em>
text
</pre>
</body>
</html>
\endcode
Tidys indenting behavior is not perfect and can sometimes cause your output to be rendered by browsers in a different way than the input. You can
avoid unexpected indenting-related rendering problems by setting `indent:no` or `indent:auto` in a config file.
\note
<b>Preserving original indenting not possible</b><br><br>
Tidy is not capable of preserving the original indenting of the markup from the input it receives. Thats because Tidy starts by
building a clean parse tree from the input, and that parse tree doesnt contain any information about the original indenting. Tidy then
pretty-prints the parse tree using the current config settings. Trying to preserve the original
indenting from the input would interact badly with the repair operations needed to build a clean parse tree, and would considerably complicate the code.
\section encodings Encodings and character references
Tidy defaults to assuming you want output to be encoded in `UTF-8`. But Tidy offers you a choice of other
character encodings: `US ASCII`, `ISO Latin-1`, and the `ISO 2022` family of 7 bit encodings.
Tidy doesnt yet recognize the use of the HTML `<meta>` element for specifying the character encoding.
The full set of HTML character references are defined. Cleaned-up output uses named character references for characters when appropriate. Otherwise,
characters outside the normal range are output as numeric character references.
\section accessibility Accessibility
Tidy offers advice on potential accessibility problems for people using non-graphical browsers.
\section cleaning_presentational Cleaning up presentational markup
Some tools generate HTML with presentational elements such as `<font>`, `<nobr>`, and `<center>`. Tidys -clean option will replace those elements with `<style>` elements and CSS.
Some HTML documents rely on the presentational effects of `<p>` start tags that are not followed by any content. Tidy deletes
such `<p>` tags (as well as any headings that dont have content). So do not use `<p>` tags simply for
adding vertical whitespace; instead use CSS, or the `<br>` element. However, note that
Tidy wont discard `<p>` tags that are followed by any non-breaking space (that is, the \code&nbsp;\endcode named character reference).
\section new_tags Teaching Tidy about new tags
You can teach Tidy about new tags by declaring them in the configuration file, the syntax is:
\code
new-inline-tags: tag1, tag2, tag3
new-empty-tags: tag1, tag2, tag3
new-blocklevel-tags: tag1, tag2, tag3
new-pre-tags: tag1, tag2, tag3
\endcode
The same tag can be defined as \b empty and as \b inline, or as \b empty and as \b block.
These declarations can be combined to define a new empty inline or empty block element, but you are not advised to
declare tags as being both \b inline and \b block.
Note that the new tags can only appear where Tidy expects inline or block-level tags respectively. That means you cant place new
tags within the document head or other contexts with restricted content models.
\section ignoring_scripting Ignoring PHP, ASP, and JSTE instructions
Tidy will gracefully ignore many cases of PHP, ASP, and JSTE instructions within element content and as replacements for attributes,
and preserve them as-is in output; for example:
\code{.php}
<option <% if rsSchool.Fields("ID").Value
= session("sessSchoolID")
then Response.Write("selected") %>
value='<%=rsSchool.Fields("ID").Value%>'>
<%=rsSchool.Fields("Name").Value%>
(<%=rsSchool.Fields("ID").Value%>)
</option>
\endcode
But note that Tidy may report missing attributes when those are “hidden” within the PHP, ASP, or JSTE code. If you use
PHP, ASP, or JSTE code to create a start tag, but place the end tag explicitly in the HTML markup, Tidy
wont be able to match them up, and will delete the end tag. In that case you are advised to make the
start tag explicit and to use PHP, ASP, or JSTE code for just the attributes; for example:
\code{.php}
<a href="<%=random.site()%>">do you feel lucky?</a>
\endcode
Tidy can also get things wrong if the PHP, ASP, or JSTE code includes quotation marks; for example:
\code{.php}
value="<%=rsSchool.Fields("ID").Value%>"
\endcode
Tidy will see the quotation mark preceding ID as ending the attribute value, and proceed to complain about what follows.
Tidy allows you to control whether line wrapping on spaces within PHP, ASP, and JSTE instructions is
enabled; see the `wrap-php`, `wrap-asp`, and `wrap-jste` config options.
\section correcting_xml Correcting well-formedness errors in XML markup
Tidy can help you to correct well-formedness errors in XML markup. Tidy doesnt yet recognize all XML features,
though; for example, it doesnt understand CDATA sections or DTD subsets.
*/

View File

@ -1,54 +0,0 @@
/*!
\page history History
Once upon a time....
<p><strong>HTML Tidy</strong> was created by the <a href="http://www.w3.org/">W3Cs</a> own <a href="http://www.w3.org/People/Raggett/">Dave Raggett</a> back in the
dawn of the Internet age. His original Internet page is still available and
gives a sense of the early history: <a href="http://www.w3.org/People/Raggett/tidy/">Clean up your Web pages with HTML TIDY</a>.</p>
<p>Satisfied with his work Dave passed the torch to a dedicated group of
maintainers at <a href="http://tidy.sourceforge.net/">tidy.sourceforge.net</a> where the important tasks of turning
<strong>Tidy</strong> into a C library and keeping up with developing standards was
performed.</p>
<p>W3C members took a renewed interest in <strong>Tidy</strong> in 2011 and forked the
project to <a href="https://github.com/w3c/tidy-html5">github</a> (now redirects to this project), where it featured
compatibility with HTML5 via a <a href="https://lists.w3.org/Archives/Public/www-archive/2011Nov/0007.html">key contribution</a> from one of the SourceForge
key members.</p>
<p>In 2015 a group of concerned developers, users, and software integrators formed
<a href="http://www.htacg.org">HTACG</a> with the goal of revitalizing <strong>Tidy</strong>, which had fallen into a
non-maintained state. As a W3C Community Group, HTACG was deemed worthy by the
W3C, and W3C passed ownership of their project to HTACG, where it is currently
being developed and prepped for a new, stable, and modern release.</p>
<p>HTACG is also working diligently with the SourceForge maintainers in an effort
to harmonize <strong>HTML Tidy</strong> into a single, stable, solid release once again.</p>
\code
+-----------------------------+
|w3.org/People/Raggett/tidy/|
++-------------+--------------+
||
||+----------------------+
|+-->|tidy.sourceforge.net|
|+------------------+---+
||
|+--------------------+------+|Soon
+-->|github.com/w3c/tidy|html5||
+-+------------------+------+|
||
||+-------------------------------+
|+->|Youarehere:|
||github.com/htacg/tidy-html5|
+----------------------------->+----------------------+--------+
\endcode
*/

View File

@ -1,14 +0,0 @@
/*!
\page license License
License and Legal
<pre>
\htmlinclude LICENSE.md
</pre>
*/

View File

@ -1,12 +0,0 @@
/*!
\page quick_ref Quick Ref
Quick reference generated from the tidy command
\htmlinclude quickref_include.html
*/

View File

@ -1,18 +0,0 @@
/*!
Running the tidy command
\page tidy_cmd tidy command
- \subpage tidy_quickstart
- \subpage tidy_config
- \subpage featured_options
- \subpage tidy_scripting
<pre>
\htmlinclude tidy5.help.txt
</pre>
*/

View File

@ -1,46 +0,0 @@
/*!
\page tidy_config Configuration
Configuration settings and files
\tableofcontents
To get a list of all configuration settings, see \ref config_options below or use:
\code{.sh}
tidy -help-config
\endcode
\section using_config Using a configuration file
The most convenient way to configure Tidy is by using separate configuration file.
Assuming you have created a Tidy configuration file named `myconfig.txt` (the name and extension dont matter), you can instruct Tidy to use it via the
command line option `-config myconfig.txt` for example:
\code {.sh}
tidy -config myconfig.txt file1.html file2.html
\endcode
Alternatively, you can name the default config file via the environment
variable named `HTML_TIDY`, the value of which is the absolute path for the config file.
You can also set config options on the command line by preceding the name of the option
immediately (no intervening space) with the string “--”; for example:
\code {.sh}
tidy --break-before-br true --show-warnings false
\endcode
You can find documentation for full set of configuration options on the \ref quick_ref page.
\section example_config Example Configuration File
\include example_config.txt
\section config_options Config Options
<pre>
\htmlinclude tidy5.config.txt
</pre>
*/

View File

@ -1,71 +0,0 @@
/*!
\page tidy_quickstart tidy command quickstart
\tableofcontents
This is the syntax for invoking Tidy from the command line:
\code{.sh}
tidy [[options] filename]
\endcode
Tidy defaults to reading from standard input, so if you run Tidy without specifying the filename argument, it will just sit there waiting for input to read.
Tidy defaults to writing to standard output. So you can pipe output from Tidy to other programs, as well as pipe output from other programs to Tidy. You can page through the output from Tidy by piping it to a pager, e.g.:
\code{.sh}
tidy file.html | less
\endcode
\section out_file Output to file
To have Tidy write its output to a file instead, either use the
\code{.sh}
-o filename
or
-output filename
\endcode
option, or redirect standard output to the file. For example:
\code{.sh}
tidy -o output.html index.html
tidy -output output.html index.html
tidy index.html > output.html
\endcode
All the above run Tidy on the file `index.html` and write the output to the file `output.html`, while writing any error messages to standard error.
\section out_error Error output
Tidy defaults to writing its error messages to standard error (that is, to the console where youre running Tidy). To page through the error messages along with the
output, redirect standard error to standard output, and pipe it to your pager:
\code{.sh}
tidy index.html 2>&1 | less
\endcode
To have Tidy write the errors to a file instead, either use
\code{.sh}
-f filename
or
-file filename
\endcode
option, or redirect standard error to a file:
\code{.sh}
tidy -o output.html -f errs.txt index.html
tidy index.html > output.html 2> errs.txt
\endcode
Both the above run Tidy on the file `index.html` and writes the output to the file `output.html`, while writing any error messages to the `file errs.txt`.
Writing the error messages to a file is especially useful if the file you are checking has many errors; reading them from a file instead of the console
or pager can make it easier to review them.
\section out_modify Modify / Overwrite
You can use the or `-m` or `-modify` option to modify (in-place) the contents of the input file you are checking; that is, to overwrite those contents with the output from Tidy. For example:
\code{.sh}
tidy -f errs.txt -m index.html
\endcode
That runs Tidy on the file `index.html`, modifying it in place and writing the error messages to the file `errs.txt`.
\warning If you use the `-m` option, you should first ensure that you have a backup copy of your file.
*/

View File

@ -1,31 +0,0 @@
/*!
\page tidy_scripting Running tidy in scripts
If you want to run Tidy from a Perl, bash, or other scripting language you may find it of value to inspect the result returned
by Tidy when it exits:
- \b 0 = if everything is fine
- \b 1 = if there were warnings and
- \b 2 = if there were errors.
\section perl_example_script Example Perl script
\code{.pl}
if (close(TIDY) == 0) {
my $exitcode = $? &gt;&gt; 8;
if ($exitcode == 1) {
printf STDERR "tidy issued warning messages\n";
} elsif ($exitcode == 2) {
printf STDERR "tidy issued error messages\n";
} else {
die "tidy exited with code: $exitcode\n";
}
} else {
printf STDERR "tidy detected no errors\n";
}
\endcode
*/

View File

@ -1,53 +0,0 @@
/*!
\page tidylib tidylib
About the tidylib C library and code
\tableofcontents
\section about_tidylib TidyLib features
- easy to integrate. Because of the near universal adoption of C linkage, a C interface may be called from a great number of programming languages.
- designed to use opaque types in the public interface. This allows the application to just pass an integer around and the need to transform data types in different languages is minimized. As a results its straight-forward to write very thin library wrappers for C++, Pascal, and COM/ATL.
- eats its own dogfood. HTML Tidy links directly to TidyLib.
- is Thread Safe and Re-entrant. Because there are many uses for HTML Tidy - from content validation, content scraping, conversion to XHTML - it was important to make TidyLib run reasonably well within server applications as well as client side.
- uses adaptable I/O. As part of the larger integration strategy it was decided to fully abstract all I/O. This means a (relatively) clean separation between character encoding processing and shovelling bytes back and forth. Internally, the library reads from sources and writes to sinks. This abstraction is used for both markup and configuration “files”. Concrete implementations are provided for file and memory I/O, and new sources and sinks may be provided via the public interface.
\section return_code Return codes
Its important to understand that API functions that return an integer almost universally adhere to the following convention:
- \b 0 == \b Success
- Good to go.
- \b 1 == \b Warnings, but no errors
- Check the error buffer or track error messages for details.
- \b 2 == \b Errors (and maybe warnings)
- By default, Tidy will not produce output. You can force output with the TidyForceOutput option. As with warnings, check error buffer or track error messages for details.
- <b>< 0</b> == <b>Severe error</b>
- Usually value equals `-errno`. See errno.h.
Also, by default, warning and error messages are sent to stderr. You can redirect diagnostic
output using either tidySetErrorFile() or tidySetErrorBuffer(). See tidy.h for details.
\section app_notes Application Notes
Of course, there are functions to parse and save both markup and configuration files. For the adventurous, it is possible to create new input sources and output sinks. For example, a URL source could pull the markup from a given URL.
It is also worth remembering that an application may instantiate any number of document and buffer objects. They are fairly cheap to initialize and destroy (just memory allocation and zeroing, really), so they may be created and destroyed locally, as needed. There is no problem keeping them around a while for keeping state. For example, a server app might keep a global document as a master configuration. As documents are parsed, they can copy their configuration data from the master instance. See tidyOptCopyConfig(). If the master copy is initialized at startup, no synchronization is necessary.
\section example_hello tidylib example
\include example.1.c
*/

View File

@ -1,14 +0,0 @@
/*!
\page todo Todo List
The todo list.
\note If this page is empty, then there are no todo items flagged in source.
\xrefitem todo "Todo" "Todo List"
*/

View File

@ -1,244 +0,0 @@
<?xml version="1.0"?>
<!--
For generating the `quickref.html` web page from output of
`tidy -xml-config`
(c) 2005 (W3C) MIT, ERCIM, Keio University
See tidy.h for the copyright notice.
Written by Charles Reitzel and Jelks Cabaniss
-->
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
encoding="us-ascii"
omit-xml-declaration="yes"
/>
<xsl:template match="/">
<a name="qtop"></a>
<h2 id="top">Option Groups</h2>
<ul>
<li><a class="h3" href="#MarkupHeader">HTML, XHTML, XML</a></li>
<li><a class="h3" href="#DiagnosticsHeader">Diagnostics</a></li>
<li><a class="h3" href="#PrettyPrintHeader">Pretty Print</a></li>
<li><a class="h3" href="#EncodingHeader">Character Encoding</a></li>
<li><a class="h3" href="#MiscellaneousHeader">Miscellaneous</a></li>
</ul>
<xsl:call-template name="link-section" />
<xsl:call-template name="detail-section" />
</xsl:template>
<!-- Named Templates: -->
<xsl:template name="link-section">
<table summary="Tidy Options Quick Reference Header Section" border="0"
cellpadding="3" cellspacing="0" class="quickref">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<xsl:call-template name="links">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousHeader</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="detail-section">
<table summary="Tidy Options Quick Reference Detail Section" border="0"
cellpadding="3" cellspacing="0">
<xsl:call-template name="reference">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousReference</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="links">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr valign="bottom">
<td class="h3" colspan="2" id="{$headerID}">
<xsl:value-of select="$header"/> Options</td>
<td valign="top" class="h3top"><a href="#qtop" class="h3topa">Top</a></td>
</tr>
<xsl:call-template name="ClassHeaders" />
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td class="qrow"><a href="#{name}"><xsl:value-of select="name"/></a></td>
<td class="qrow"><xsl:apply-templates select="type"/></td>
<td class="qrow"><xsl:choose>
<xsl:when test="string-length(default) &gt; 0 ">
<xsl:apply-templates select="default" />
</xsl:when>
<xsl:otherwise>
<strong>-</strong>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr valign="bottom">
<td colspan="3">&#160;</td>
</tr>
</xsl:template>
<xsl:template name="reference">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr>
<td colspan="3">&#160;</td>
</tr>
<tr valign="bottom">
<td valign="top" colspan="3" class="h2" id="{$headerID}">
<h2 class="qh2"><xsl:value-of select="$header"/></h2>
</td>
</tr>
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td valign="top" id="{name}" colspan="2" class="qoptiontitletd">
<h4 class="qoptiontitle"><xsl:value-of select="name"/></h4>
</td>
<td class="tabletitlelink" valign="top" align="right">
<a href="#qtop">Top</a>
</td>
</tr>
<tr>
<td valign="top" class="qlabel">Type:</td>
<td class="qvalu"><xsl:value-of select="type"/></td>
</tr>
<tr>
<td valign="top" class="qlabel">Default:</td>
<td class="qvalu">
<xsl:choose>
<xsl:when test="string-length(default) &gt; 0">
<xsl:apply-templates select="default" />
</xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td valign="top" class="qlabel">Example:</td>
<td class="qvalu">
<xsl:choose>
<xsl:when test="string-length(example) &gt; 0">
<xsl:apply-templates select="example"/>
</xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<xsl:choose>
<xsl:when test="seealso">
<tr>
<td valign="top" class="qlabel">See Also:</td>
<td valign="top" class="qvalu">
<xsl:for-each select="seealso">
<a href="#{.}"><xsl:apply-templates select="." /></a>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:when>
</xsl:choose>
<tr>
<td></td>
<td colspan="1" class="qdescription"><xsl:apply-templates select="description"/></td>
</tr>
<tr>
<td>&#160;</td>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template name="ClassHeaders">
<tr>
<td class="tabletitle">Option</td>
<td class="tabletitle">Type</td>
<td class="tabletitle">Default</td>
</tr>
</xsl:template>
<xsl:template name="Stylesheet">
<style type="text/css">
/* no style */
</style>
</xsl:template>
<!-- Regular Templates: -->
<xsl:template match="a | code | em | strong | br">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@* | node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,574 +0,0 @@
<?xml version="1.0"?>
<!--
For generating the `quickref.html` web page from output of
`tidy -xml-config`
(c) 2005 (W3C) MIT, ERCIM, Keio University
See tidy.h for the copyright notice.
Written by Charles Reitzel and Jelks Cabaniss
-->
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
encoding="us-ascii"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
<xsl:template match="/">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML Tidy Configuration Options Quick Reference</title>
<xsl:call-template name="Stylesheet" />
</head>
<body>
<h1 id="top">Quick Reference</h1>
<h2>HTML Tidy Configuration Options</h2>
<p>Version: <xsl:value-of select="config/@version" /></p>
<p><a class="h3" href="#MarkupHeader">HTML, XHTML, XML</a><br />
<a class="h3" href="#DiagnosticsHeader">Diagnostics</a><br />
<a class="h3" href="#PrettyPrintHeader">Pretty Print</a><br />
<a class="h3" href="#EncodingHeader">Character Encoding</a><br />
<a class="h3" href="#MiscellaneousHeader">Miscellaneous</a></p>
<xsl:call-template name="link-section" />
<xsl:call-template name="detail-section" />
</body>
</html>
</xsl:template>
<!-- Named Templates: -->
<xsl:template name="link-section">
<table summary="Tidy Options Quick Reference Header Section" border="0"
cellpadding="3" cellspacing="0">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<xsl:call-template name="links">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousHeader</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="detail-section">
<table summary="Tidy Options Quick Reference Detail Section" border="0"
cellpadding="3" cellspacing="0">
<xsl:call-template name="reference">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousReference</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="links">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr valign="bottom">
<td class="h3" colspan="2" id="{$headerID}">
<xsl:value-of select="$header"/> Options</td>
<td valign="top"><a href="#top">Top</a></td>
</tr>
<xsl:call-template name="ClassHeaders" />
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td><a href="#{name}"><xsl:value-of select="name"/></a></td>
<td><xsl:apply-templates select="type"/></td>
<td><xsl:choose>
<xsl:when test="string-length(default) &gt; 0 ">
<xsl:apply-templates select="default" />
</xsl:when>
<xsl:otherwise>
<strong>-</strong>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr valign="bottom">
<td colspan="3">&#160;</td>
</tr>
</xsl:template>
<xsl:template name="reference">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr>
<td>&#160;</td>
</tr>
<tr valign="bottom">
<td valign="top" colspan="2" class="h2" id="{$headerID}">
<xsl:value-of select="$header"/> Options Reference
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td class="tabletitle" valign="top" id="{name}">
<xsl:value-of select="name"/>
</td>
<td class="tabletitlelink" valign="top" align="right">
<a href="#top">Top</a></td>
</tr>
<tr>
<td valign="top">Type: <strong><xsl:value-of
select="type"/></strong><br />
<xsl:choose>
<xsl:when test="string-length(default) &gt; 0">
Default: <strong><xsl:apply-templates select="default" /></strong>
</xsl:when>
<xsl:otherwise>
Default: <strong>-</strong>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(example) &gt; 0">
<br />Example: <strong><xsl:apply-templates
select="example"/></strong>
</xsl:when>
<xsl:otherwise>
<br />Example: <strong>-</strong>
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right" valign="top">
<xsl:for-each select="seealso">
<a href="#{.}"><xsl:apply-templates select="." /></a>
<xsl:if test="position() != last()">
<br />
</xsl:if>
</xsl:for-each>
</td>
</tr>
<tr>
<td colspan="2"><xsl:apply-templates select="description"/></td>
</tr>
<tr>
<td>&#160;</td>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template name="ClassHeaders">
<tr>
<td class="tabletitle">Option</td>
<td class="tabletitle">Type</td>
<td class="tabletitle">Default</td>
</tr>
</xsl:template>
<xsl:template name="Stylesheet">
<style type="text/css">
/* 1st Style ignored by Netscape */
td.dummy, font.dummy, .dummy, a:link.dummy, a:visited.dummy, a:active.dummy
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 16pt;
color: #336699;
text-decoration: none;
font-weight: normal
}
body
{
margin-left: 10%;
margin-right: 10%;
font-family: sans-serif;
background-color: #FFFFFF
}
/* Blue TITLE */
td.title, font.title, .title, a:link.title, a:visited.title, a:active.title
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 16pt;
color: #336699;
text-decoration: none;
font-weight: normal
}
/* BODY TEXT */
td.text, font.text, .text, a:link.text, a:visited.text, a:active.text
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
color: #000000;
text-decoration: none;
font-weight: normal
}
/* BOLD BODY TEXT */
td.textbold, font.textbold, .textbold, a:link.textbold, a:visited.textbold, a:active.textbold
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
color: #000000;
text-decoration: none;
font-weight: bold
}
/* BOLD BODY TEXT LINK WITH UNDERLINE*/
td.textboldlink, font.textboldlink, .textboldlink, a:link.textboldlink, a:visited.textboldlink, a:active.textboldlink
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
color: #000000;
font-weight: bold
}
/* SMALL BODY TEXT */
td.smtext, font.smtext, .smtext, a:link.smtext, a:visited.smtext, a:active.smtext
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #000000;
text-decoration: none;
font-weight: normal
}
/* SMALL BOLD BODY TEXT */
td.smtextbold, font.smtextbold, .smtextbold, a:link.smtextbold, a:visited.smtextbold, a:active.smtextbold
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #000000;
text-decoration: none;
font-weight: bold
}
/* TITLES
td.title, font.title, .title, a:link.title, a:visited.title, a:active.title
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #CC3300;
text-decoration: none;
font-weight: bold
}
*/
/* SUBTITLES */
td.subtitle, font.subtitle, .subtitle, a:link.subtitle, a:visited.subtitle, a:active.subtitle
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 11pt;
color: #000000;
text-decoration: none;
font-weight: bold
}
/* LEGAL TEXT */
td.legal, font.legal, .legal, a:link.legal, a:visited.legal, a:active.legal
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #000000;
text-decoration: none;
font-weight: normal
}
td.legallink, font.legallink, .legallink, a:link.legallink, a:visited.legallink, a:active.legallink
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #CC3300;
font-weight: normal
}
/* RED TEXT */
td.textred, font.textred, .textred, a:link.textred, a:visited.textred, a:active.textred
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #CC3300;
text-decoration: none;
font-weight: normal
}
/* RED TEXT BOLD*/
td.textredbold, font.textredbold, .textredbold, a:link.textredbold, a:visited.textredbold, a:active.textredbold
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #CC3300;
text-decoration: none;
font-weight: bold
}
/* LINKS */
td.link, font.link, .link, a:link.link, a:visited.link, a:active.link
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #3366CC;
font-weight: normal
}
td.tabletitlelink, font.tabletitlelink, .tabletitlelink, a:link.tabletitlelink, a:visited.tabletitlelink, a:active.tabletitlelink
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
background-color: #e9e9d3;
color: #000000;
}
/* TABLE TITLES */
td.tabletitle, font.tabletitle, .tabletitle, a:link.tabletitle, a:visited.tabletitle, a:active.tabletitle
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #336699;
background-color: #e9e9d3;
/* text-decoration: none; */
font-weight: bold
}
/* TABLE CELL */
td.cell, tr.cell, font.cell, .cell, a:link.cell, a:visited.cell, a:active.cell
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #000000;
font-weight: normal;
/* background-color: #e9e9d3 */
background-color: #f5f5f5
}
/* SHADED TABLE CELL */
td.shaded, tr.shaded, font.shaded, .shaded, a:link.shaded, a:visited.shaded, a:active.shaded
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #000000;
font-weight: normal;
background-color: #f5f5f5
}
/* GLOSSARY TERM */
td.term, font.term, .term, a:link.term, a:visited.term, a:active.term
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-style: normal;
color: #000000;
text-decoration: none;
font-weight: normal
}
/* ELEMENT TAGS */
ul
{
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: normal
}
li
{
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: normal
}
a:link.h1, a:visited.h1, .h1
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #0066CC
}
a:active.h1
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
font-weight: bold;
color: #0066CC
}
h1
{
margin-left: -8%;
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #0066CC
}
.h2
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 11pt;
/* font-weight: bold; */
color: #000000
}
h2
{
margin-left: -4%;
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 11pt;
/* font-weight: bold; */
color: #000000
}
A:link.h3, A:visited.h3, .h3
{ font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #000000;
font-weight: bold
}
A:active.h3
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #000000;
font-weight: bold
}
h3
{
margin-left: -4%;
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-weight: bold;
color: #000000
}
h4
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
font-weight: bold;
color: #000000
}
.code, A:active.code, A:link.code, A:visited.code
{
font-family: "Courier New", Courier, monospace;
}
.abstract
{
font-style : italic;
}
p
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-style: normal
}
td
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-style: normal
}
/* LINKS */
a:link, a:active
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #3366CC;
font-weight: normal
}
a:visited
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #333366;
font-weight: normal
}
code {
/* use browser/user default for `font-family` */
font-weight: bold;
color: brown;
background: transparent;
}
</style>
</xsl:template>
<!-- Regular Templates: -->
<xsl:template match="a | code | em | strong | br">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@* | node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,304 +0,0 @@
body {
background-color: #efefef;
}
#titlearea {
background-image: url(http://www.html-tidy.org/assets/images/green-abstract-background.jpg);
background-size: cover;
}
#projectname {
font-family: sans-serif;
font-size: 22pt;
margin: 0 0 0 0;
margin-left: 150px;
padding: 2px 0px;
color: white;
}
#projectnumber {
font-size: 12pt;
}
#projectbrief {
font-family: sans-serif;
font-size: 10pt;
color: #dddddd;
margin-left: 150px;
}
.contents h1 {
font-size: 15pt;
font-family: monospace;
color: #4D4D74;
font-weight: bold;
border-left: none;
border-top: none;
border-bottom: 2px solid #cccccc;
margin: 30px 0px 10px 0px;
padding: 5px 0 5px 10px;
}
.contents h2 {
font-size: 12pt;
font-family: monospace;
color: #4D4D74;
font-weight: bold;
border-top: none;
border-bottom: 1px solid #dddddd;
margin: 20px 20% 20px 0px;
padding: 2px 0 2px 10px;
}
.contents p {
line-height: 130%;
font-size: 11pt;
font-family: sans-serif;
margin: 10px 20% 15px 10px;
padding: 0px;
}
.contents ul{
list-style-type: disc;
font-size: 11pt;
margin: 5px 20% 5px 40px;
padding: 0px;
line-height: 140%;
}
.contents ul ul{
list-style-type: circle;
margin-left: 30px;
}
.contents li{
padding: 2px 0 2px 0;
margin: 0;
ssbackground-color: pink;
}
.contents .textblock{
font-size: 10pt;
margin: 10px 50px 10px 50px;
line-height: 140%;
}
.contents .textblock code{
font-family: monospace;
font-size: 9pt;
}
.contents .todo{
font-size: 11pt;
margin: 10px 10% 20px 30px;
}
.contents .bug{
font-size: 11pt;
margin: 10px 10% 20px 30px;
}
dl
{
padding: 0 0 0 10px;
}
/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
dl.section
{
margin-left: 0px;
padding-left: 0px;
}
dl.note
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left: 4px solid;
border-color: #D0C000;
background-color: #FFFAC5;
border-radius: 10px;
}
ul dl.note{
margin-right: 0;
}
dl.warning, dl.attention
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left: 4px solid;
border-color: #FF909F;
background-color: #FFE1E5;
border-radius: 10px;
}
dl.pre, dl.post, dl.invariant
{
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #00D000;
}
dl.deprecated
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left:4px solid #B10BBF;
background-color: #FBC9FF;
border-radius: 10px;
}
dl.todo
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left:4px solid #00C0E0;
background-color: #DCFAFF ;
border-radius: 10px;
}
dl.bug
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left:4px solid red;
background-color: #FFC3B9 ;
border-radius: 10px;
}
dl.test
{
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #3030E0;
}
dl.bug
{
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #C08050;
}
dl.section dd {
margin-bottom: 6px;
}
table.directory tr {
border-bottom: 1px solid #cccccc !important;
}
table.directory tr:hover {
background-color: #F6FF88 !important;
}
table.directory td {
padding: 5px;
font-family: sans-serif;
}
/*****************************************************/
/* Quickref */
table.quickref {
font-size: 9pt;
font-family: monospace;
}
table.quickref tr:hover{
background-color: #F6FF88;
}
table.quickref td.qrow {
border-bottom: 1px solid #cccccc !important;
}
table td.h2 {
padding: 0;
margin: 0;
}
.qh2 {
background-color: #333333;
color: #eeeeee !important;
padding: 10px;
border-radius: 5px;
border: none;
margin: 0;
padding: 8px;
font-size: 15pt;
width: 100%;
}
table td.h3 {
background-color: #333333;
color: #eeeeee;
padding: 8px;
border-top-left-radius: 8px;
}
table td.h3top {
background-color: #333333;
padding: 8px;
border-top-right-radius: 8px;
text-align: right;
font-size: 8pt;
}
table td.h3top a{
color: #dddddd !important;
}
.h3topssssa {
color: #333333;
}
table td.tabletitle {
background-color: #cccccc;
font-size: 8pt;
}
td.tabletitlelink {
font-size: 8pt;
}
td.qoptiontitletd {
padding: 0;
margin: 0;
}
h4.qoptiontitle {
background-color: #bbbbbb;
font-size: 11pt;
font-weight: bold;
font-family: monospace;
padding: 5px 5px 5px 10px;
margin: 0;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.qlabel {
text-align: right;
font-size: 9pt;
width: 80px;
border-bottom: 1px solid #bbbbbb;
background-color: #dddddd;
font-family: sans-serif;
}
.qvalu {
font-size: 9pt;
font-weight: bold;
border-bottom: 1px solid #bbbbbb;
font-family: monospace;
border-left: 1px solid #bbbbbb;
}
.qdescription {
font-size: 11pt;
color: #333333;
margin: 0;
padding: 5px;
line-height: 140%;
border-left: 1px solid #bbbbbb;
border-bottom: 1px solid #bbbbbb;
}

View File

@ -1,448 +0,0 @@
<?xml version="1.0"?>
<!--
For generating the `tidy.1` man page from the
output of `tidy -xml-help` and `tidy -xml-config`
(c) 2005-2007 (W3C) MIT, ERCIM, Keio University
See tidy.h for the copyright notice.
Written by Jelks Cabaniss and Arnaud Desitter
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="description" />
<xsl:output method="text" />
<!--
The default template match is to the document passed on the
command line to the XSLT processor, currently "tidy-help.xml".
For the detailed config options section however, the template
match is to the file "tidy-config.xml". This is captured in
the $CONFIG variable, declared here:
-->
<xsl:variable name="CONFIG" select="document('../cmake/tidy-config.xml')"/>
<!-- Main Template: -->
<xsl:template match="/">
<xsl:call-template name="header-section" />
<xsl:call-template name="cmdline-section" />
<xsl:call-template name="config-section" />
<xsl:call-template name="manpage-see-also-section" />
</xsl:template>
<!-- Named Templates: -->
<xsl:template name="header-section">
<xsl:text/>.\" tidy man page for the HTML Tidy
.TH TIDY 1 "<xsl:value-of select="cmdline/@version" />" "HTML Tidy" "<xsl:value-of select="cmdline/@version" />"
</xsl:template>
<xsl:template name="cmdline-section">
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
\fBtidy\fR - check, correct, and pretty-print HTML(5) files
.SH SYNOPSIS
\fBtidy\fR [option ...] [file ...] [option ...] [file ...]
.SH DESCRIPTION
Tidy reads HTML, XHTML, and XML files and writes cleaned-up markup. For HTML variants, it detects, reports, and corrects many common coding errors and strives to produce visually equivalent markup that is both conformant to the HTML specifications and that works in most browsers.
.LP
A common use of Tidy is to convert plain HTML to XHTML. For generic XML files, Tidy is limited to correcting basic well-formedness errors and pretty printing.
.LP
If no input file is specified, Tidy reads the standard input. If no output file is specified, Tidy writes the tidied markup to the standard output. If no error file is specified, Tidy writes messages to the standard error.
For command line options that expect a numerical argument, a default is assumed if no meaningful value can be found.
.SH OPTIONS
<xsl:call-template name="show-cmdline-options" />
.SH USAGE
.LP
Use \fB--\fR\fIoptionX valueX\fR for the detailed configuration option "optionX" with argument "valueX". See also below under \fBDetailed Configuration Options\fR as to how to conveniently group all such options in a single config file.
.LP
Input/Output default to stdin/stdout respectively. Single letter options apart from \fB-f\fR and \fB-o\fR may be combined as in:
.LP
.in 1i
\fBtidy -f errs.txt -imu foo.html\fR
.SH ENVIRONMENT
.TP
.B HTML_TIDY
Name of the default configuration file. This should be an absolute path, since you will probably invoke \fBtidy\fR from different directories. The value of HTML_TIDY will be parsed after the compiled-in default (defined with -DTIDY_CONFIG_FILE), but before any of the files specified using \fB-config\fR.
.SH "EXIT STATUS"
.IP 0
All input files were processed successfully.
.IP 1
There were warnings.
.IP 2
There were errors.
</xsl:template>
<xsl:template name="config-section">
.SH ______________________________
.SH " "
.SH "DETAILED CONFIGURATION OPTIONS"
This section describes the Detailed (i.e., "expanded") Options, which may be specified by preceding each option with \fB--\fR at the command line, followed by its desired value, OR by placing the options and values in a configuration file, and telling tidy to read that file with the \fB-config\fR standard option.
.SH SYNOPSIS
\fBtidy --\fR\fIoption1 \fRvalue1 \fB--\fIoption2 \fRvalue2 [standard options ...]
.br
\fBtidy -config \fIconfig-file \fR[standard options ...]
.SH WARNING
The options detailed here do not include the "standard" command-line options (i.e., those preceded by a single '\fB-\fR') described above in the first section of this man page.
.SH DESCRIPTION
A list of options for configuring the behavior of Tidy, which can be passed either on the command line, or specified in a configuration file.
.LP
A Tidy configuration file is simply a text file, where each option
is listed on a separate line in the form
.LP
.in 1i
\fBoption1\fR: \fIvalue1\fR
.br
\fBoption2\fR: \fIvalue2\fR
.br
etc.
.LP
The permissible values for a given option depend on the option's \fBType\fR. There are five types: \fIBoolean\fR, \fIAutoBool\fR, \fIDocType\fR, \fIEnum\fR, and \fIString\fR. Boolean types allow any of \fIyes/no, y/n, true/false, t/f, 1/0\fR. AutoBools allow \fIauto\fR in addition to the values allowed by Booleans. Integer types take non-negative integers. String types generally have no defaults, and you should provide them in non-quoted form (unless you wish the output to contain the literal quotes).
.LP
Enum, Encoding, and DocType "types" have a fixed repertoire of items; consult the \fIExample\fR[s] provided below for the option[s] in question.
.LP
You only need to provide options and values for those whose defaults you wish to override, although you may wish to include some already-defaulted options and values for the sake of documentation and explicitness.
.LP
Here is a sample config file, with at least one example of each of the five Types:
.LP
\fI
// sample Tidy configuration options
output-xhtml: yes
add-xml-decl: no
doctype: strict
char-encoding: ascii
indent: auto
wrap: 76
repeated-attributes: keep-last
error-file: errs.txt
\fR
.LP
Below is a summary and brief description of each of the options. They are listed alphabetically within each category. There are five categories: \fIHTML, XHTML, XML\fR options, \fIDiagnostics\fR options, \fIPretty Print\fR options, \fICharacter Encoding\fR options, and \fIMiscellaneous\fR options.
.LP
.SH OPTIONS
<xsl:call-template name="show-config-options" />
</xsl:template>
<xsl:template name="show-cmdline-options">
.SS File manipulation
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">file-manip</xsl:with-param>
</xsl:call-template>
.SS Processing directives
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">process-directives</xsl:with-param>
</xsl:call-template>
.SS Character encodings
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">char-encoding</xsl:with-param>
</xsl:call-template>
.SS Miscellaneous
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">misc</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="cmdline-detail">
<!--
For each option in one of the 3 categories/classes, provide its
1. names
2. description
3. equivalent configuration option
-->
<xsl:param name="category" />
<xsl:for-each select='/cmdline/option[@class=$category]'>
<xsl:text>
.TP
</xsl:text>
<xsl:call-template name="process-names" />
<xsl:text>
</xsl:text>
<xsl:apply-templates select="description" />
<xsl:text>
</xsl:text>
<xsl:call-template name="process-eqconfig" />
</xsl:for-each>
</xsl:template>
<xsl:template name="process-names">
<!-- Used only in the cmdline section -->
<xsl:for-each select="name">
<xsl:text />\fB<xsl:value-of select="." />\fR<xsl:text />
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="process-eqconfig">
<!-- Used only in the cmdline section -->
<xsl:if test="string-length(eqconfig) &gt; 0">
<xsl:for-each select="eqconfig">
<xsl:text>(\fI</xsl:text>
<xsl:value-of select="." />
<xsl:text>\fR)</xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:template>
<xsl:template name="show-config-options">
<!-- Used only in the cmdline section -->
.SS HTML, XHTML, XML options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">markup</xsl:with-param>
</xsl:call-template>
.SS Diagnostics options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">diagnostics</xsl:with-param>
</xsl:call-template>
.SS Pretty Print options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">print</xsl:with-param>
</xsl:call-template>
.SS Character Encoding options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">encoding</xsl:with-param>
</xsl:call-template>
.SS Miscellaneous options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">misc</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!--
Note that any templates called implicitly or explicitly
from the "config-detail" template below will match on
the document referred to by the $CONFIG variable, i.e.,
the file "tidy-config.xml", created by running
tidy -xml-config > tidy-config.xml
The $CONFIG variable is set at the top level of this
stylesheet.
-->
<xsl:template name="config-detail">
<!--
For each option in one of the 5 categories/classes, provide its
1. name
2. type
3. default (if any)
4. example (if any)
5. seealso (if any)
6. description
-->
<xsl:param name="category" />
<xsl:for-each select='$CONFIG/config/option[@class=$category]'>
<xsl:sort select="name" order="ascending" />
.TP
\fB<xsl:apply-templates select="name" />\fR
Type: \fI<xsl:apply-templates select="type" />\fR
.br
<xsl:call-template name="provide-default" />
.br
<xsl:call-template name="provide-example" />
<xsl:text>
</xsl:text>
<xsl:apply-templates select="description" />
<xsl:call-template name="seealso" />
</xsl:for-each>
</xsl:template>
<!-- Used only in the config options section: -->
<xsl:template name="seealso">
<xsl:if test="seealso">
<xsl:text>
</xsl:text>
.rj 1
\fBSee also\fR: <xsl:text />
<xsl:for-each select="seealso">
<xsl:text />\fI<xsl:value-of select="." />\fR<xsl:text />
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!-- Used only in the config options section: -->
<xsl:template name="provide-default">
<!--
Picks up the default from the XML. If the `default` element
doesn't exist, or it's empty, a single '-' is provided.
-->
<xsl:choose>
<xsl:when test="string-length(default) &gt; 0 ">
<xsl:text />Default: \fI<xsl:apply-templates
select="default" />\fR<xsl:text />
</xsl:when>
<xsl:otherwise>
<xsl:text />Default: \fI-\fR<xsl:text />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Used only in the config options section: -->
<xsl:template name="provide-example">
<!--
By default, doesn't output examples for String types (mirroring the
quickref page). But for *any* options in the XML instance that
have an `example` child, that example will be used in lieu of a
stylesheet-provided one. (Useful e.g. for `repeated-attributes`).
-->
<xsl:choose>
<xsl:when test="string-length(example) &gt; 0">
<xsl:text />Example: \fI<xsl:apply-templates
select="example" />\fR<xsl:text />
</xsl:when>
<xsl:otherwise>
<xsl:text />Default: \fI-\fR<xsl:text />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Called from the templates below matching `code`, `em`, `strong`: -->
<xsl:template name="escape-backslash">
<!--
Since backslashes are "special" to the *roff processors used
to generate man pages, we need to escape backslash characters
appearing in content with another backslash.
-->
<xsl:choose>
<xsl:when test="contains(.,'\')">
<xsl:value-of select=
"concat( substring-before(.,'\'), '\\', substring-after(.,'\') )" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Appears at the bottom of the man page: -->
<xsl:template name="manpage-see-also-section">
.SH SEE ALSO
For more information about HTML Tidy:
.RS 4
.LP
http://www.html-tidy.org/
.RE
.LP
For more information on HTML:
.RS 4
.LP
\fBHTML: Edition for Web Authors\fR (the latest HTML specification)
.br
http://dev.w3.org/html5/spec-author-view
.LP
\fBHTML: The Markup Language\fR (an HTML language reference)
.br
http://dev.w3.org/html5/markup/
.RE
.LP
For bug reports and comments:
.RS 4
.LP
https://github.com/htacg/tidy-html5/issues/
.RE
.LP
Or send questions and comments to \fBpublic-htacg@w3.org\fR.
.LP
Validate your HTML documents using the \fBW3C Nu Markup Validator\fR:
.RS 4
.LP
http://validator.w3.org/nu/
.RE
.SH AUTHOR
\fBTidy\fR was written by \fBDave Raggett\fR &lt;dsr@w3.org&gt;, and subsequently maintained by a team at http://tidy.sourceforge.net/,
and now maintained by \fBHTACG\fR (http://www.htacg.org).
.LP
The sources for \fBHTML Tidy\fR are available at https://github.com/htacg/tidy-html5/ under the MIT Licence.
</xsl:template>
<!-- Regular Templates: -->
<xsl:template match="description">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="a">
<xsl:apply-templates />
<xsl:text /> at \fI<xsl:value-of select="@href" />\fR<xsl:text />
</xsl:template>
<xsl:template match="code | em">
<xsl:text />\fI<xsl:call-template name="escape-backslash" />\fR<xsl:text />
</xsl:template>
<xsl:template match="br">
<xsl:text>
.br
</xsl:text>
</xsl:template>
<xsl:template match="strong">
<xsl:text />\fB<xsl:call-template name="escape-backslash" />\fR<xsl:text />
</xsl:template>
<!--
The following templates
a) normalize whitespace, primarily necessary for `description`
b) do so without stripping possible whitespace surrounding `code`
d) strip leading and trailing whitespace in 'description` and `code`
(courtesy of Ken Holman on the XSL-list):
-->
<xsl:template match="text()[preceding-sibling::node() and
following-sibling::node()]">
<xsl:variable name="ns" select="normalize-space(concat('x',.,'x'))"/>
<xsl:value-of select="substring( $ns, 2, string-length($ns) - 2 )" />
</xsl:template>
<xsl:template match="text()[preceding-sibling::node() and
not( following-sibling::node() )]">
<xsl:variable name="ns" select="normalize-space(concat('x',.))"/>
<xsl:value-of select="substring( $ns, 2, string-length($ns) - 1 )" />
</xsl:template>
<xsl:template match="text()[not( preceding-sibling::node() ) and
following-sibling::node()]">
<xsl:variable name="ns" select="normalize-space(concat(.,'x'))"/>
<xsl:value-of select="substring( $ns, 1, string-length($ns) - 1 )" />
</xsl:template>
<xsl:template match="text()[not( preceding-sibling::node() ) and
not( following-sibling::node() )]">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,37 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;\f2\fswiss\fcharset0 Helvetica-Oblique;
\f3\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11905\paperh16837\margl1440\margr1440\vieww25720\viewh15920\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc\partightenfactor0
\f0\b\fs36 \cf0 HTACG HTML Tidy for macOS
\fs24 \
\
\fs28 https://www.html-tidy.org
\f1\b0\fs24 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
Installer will install
\f2\i HTML Tidy
\f1\i0 for macOS.\
\
This version is much newer than the version supplied by Apple, which is only recent as of October 2006. This version of
\f2\i HTML Tidy
\f1\i0 supports HTML5, which is probably the most important thing. Additionally it supports a lot of extended attributes and other things that have made their way into HTML since 2006.\
\
It will not replace the built in version of
\f2\i HTML Tidy
\f1\i0 included in macOS, but it will act as a replacement by default.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\b \cf0 Important note
\f1\b0 \
\
This installer places files into
\f3 /usr/local/
\f1 which is the correct location for Unix files such as this. Normally macOS allows the installer to access this directory, but early upgrade-installed versions of macOS 10.11 El Capitan prevented this. If the installer fails and you are still running El Capitan, please ensure that you are using the latest point release of that operating system.\
}

View File

@ -0,0 +1,34 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11740\viewh11980\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 Copyright \'a9 1998-2008 World Wide Web Consortium (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved.\
\
Contributing Author(s):\
Dave Raggett <dsr@w3.org>\
\
The contributing author(s) would like to thank all those who helped with testing, bug fixes and suggestions for improvements. This wouldn't have been possible without your help.\
\
\f1\b COPYRIGHT NOTICE:
\f0\b0 \
\
This software and documentation is provided "as is," and the copyright holders and contributing author(s) make no 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. \
\
The copyright holders and contributing author(s) will not be held liable for any direct, indirect, special or consequential damages arising out of any use of the software or documentation, even if advised of the possibility of such damage.\
\
Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, documentation and executables, for any purpose, without fee, subject to the following restrictions:\
\
1. The origin of this source code must not be misrepresented.\
2. Altered versions must be plainly marked as such and must not be misrepresented as being the original source.\
3. This Copyright notice may not be removed or altered from any source or altered source distribution.\
\
The copyright holders and contributing author(s) specifically permit, without fee, and encourage the use of this source code as a component for supporting the Hypertext Markup Language in commercial products. If you use this source code in a product, acknowledgment is not required but would be appreciated.\
\
Created 2001-05-20 by Charles Reitzel\
Updated 2002-07-01 by Charles Reitzel - 1st Implementation\
Updated 2021-04-28 by others subjected to this same license.\
}

View File

@ -20,3 +20,6 @@ install_manifest.txt
*.msi
_CPack_Packages/*
dir
*.VC.db
.vs/*
tidy.pc

View File

@ -1,3 +1,16 @@
@setlocal
@set TMPLOG=bldlog-p.txt
cmake --build . --config Release --target PACKAGE
@echo Running: 'cmake --build . --config Release --target PACKAGE' out to %TMPLOG%
@echo Running: 'cmake --build . --config Release --target PACKAGE' > %TMPLOG%
cmake --build . --config Release --target PACKAGE >> %TMPLOG%
@if ERRORLEVEL 1 goto ISERR
@echo Build package done... see %TMPLOG%
@endlocal
@exit /b 0
:ISERR
@endlocal
@exit /b 1
@REM eof

View File

@ -0,0 +1,202 @@
@setlocal
@REM 20170702 - Check branch
@set TMPBR=next
@REM 20161002 - Change to msvc140 build
@set VCVERS=14
@set GENERATOR=Visual Studio %VCVERS% Win64
@REM 20160324 - Change to relative, and use choice
@set TMPPRJ=tidy
@echo Build %TMPPRJ% project, in 64-bits
@set TMPLOG=bldlog-1.txt
@set BLDDIR=%CD%
@set TMPROOT=..\..\..
@set SET_BAT=%ProgramFiles(x86)%\Microsoft Visual Studio %VCVERS%.0\VC\vcvarsall.bat
@if NOT EXIST "%SET_BAT%" goto NOBAT
@REM if NOT EXIST %TMPROOT%\nul goto NOROOT
@set TMPSRC=..\..
@if NOT EXIST %TMPSRC%\CMakeLists.txt goto NOCM
@set DOPAUSE=1
@if /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" (
@set TMPINST=%TMPROOT%\software.x64
) ELSE (
@if /I "%PROCESSOR_ARCHITECTURE%" EQU "x86_64" (
@set TMPINST=%TMPROOT%\software.x64
) ELSE (
@echo ERROR: Appears 64-bit is NOT available... aborting...
@goto ISERR
)
)
@if NOT EXIST %TMPINST%\nul goto NOINST
@echo Doing build output to %TMPLOG%
@echo Doing build output to %TMPLOG% > %TMPLOG%
@echo Doing: 'call "%SET_BAT%" %PROCESSOR_ARCHITECTURE%'
@echo Doing: 'call "%SET_BAT%" %PROCESSOR_ARCHITECTURE%' >> %TMPLOG%
@call "%SET_BAT%" %PROCESSOR_ARCHITECTURE% >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR0
@REM call setupqt64
@cd %BLDDIR%
@REM :DNARCH
@REM ############################################
@REM NOTE: SPECIAL INSTALL LOCATION
@REM Adjust to suit your environment
@REM ##########################################
@REM set TMPINST=F:\Projects\software.x64
@set TMPOPTS=-DCMAKE_INSTALL_PREFIX=%TMPINST%
@set TMPOPTS=%TMPOPTS% -G "%GENERATOR%"
@REM set TMPOPTS=%TMPOPTS% -DTIDY_CONFIG_FILE="C:\MDOS\tidy5.cfg"
@REM set TMPOPTS=%TMPOPTS% -DTIDY_USER_CONFIG_FILE="C:\MDOS\tidy5.cfg"
@set TMPOPTS=%TMPOPTS% -DBUILD_SHARED_LIB:BOOL=OFF
:RPT
@if "%~1x" == "x" goto GOTCMD
@if "%~1x" == "NOPAUSEx" (
@set DOPAUSE=0
) else (
@set TMPOPTS=%TMPOPTS% %1
)
@shift
@goto RPT
:GOTCMD
@call chkmsvc %TMPPRJ%
@call chkbranch %TMPBR%
@if ERRORLEVEL 1 goto BADBR
:GOTBR
@echo Begin %DATE% %TIME%, output to %TMPLOG%
@echo Begin %DATE% %TIME% >> %TMPLOG%
@echo Doing: 'cmake %TMPSRC% %TMPOPTS%'
@echo Doing: 'cmake %TMPSRC% %TMPOPTS%' >> %TMPLOG%
@cmake %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR1
@echo Doing: 'cmake --build . --config debug'
@echo Doing: 'cmake --build . --config debug' >> %TMPLOG%
@cmake --build . --config debug >> %TMPLOG%
@if ERRORLEVEL 1 goto ERR2
@echo Doing: 'cmake --build . --config release'
@echo Doing: 'cmake --build . --config release' >> %TMPLOG%
@cmake --build . --config release >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR3
:DNREL
@echo Appears a successful build
@echo Note install location %TMPINST%
@echo.
@REM ##############################################
@REM Check if should continue with install
@REM ##############################################
@if "%DOPAUSE%x" == "0x" goto DOINST
@choice /? >nul 2>&1
@if ERRORLEVEL 1 goto NOCHOICE
@choice /D N /T 10 /M "Pausing for 10 seconds. Def=N"
@if ERRORLEVEL 2 goto GOTNO
@goto DOINST
:NOCHOICE
@echo Appears OS does not have the 'choice' command!
@ask *** CONTINUE with install? *** Only y continues
@if ERRORLEVEL 2 goto NOASK
@if ERRORLEVEL 1 goto DOINST
@echo Skipping install to %TMPINST% at this time...
@echo.
@goto END
:NOASK
@echo 'ask' utility not found in path...
@echo.
@echo *** CONTINUE with install? *** Only Ctrl+c aborts...
@echo.
@pause
:DOINST
@echo Proceeding with INSTALL...
@echo.
@REM cmake -P cmake_install.cmake
@echo Doing: 'cmake --build . --config debug --target INSTALL'
@echo Doing: 'cmake --build . --config debug --target INSTALL' >> %TMPLOG%
@cmake --build . --config debug --target INSTALL >> %TMPLOG% 2>&1
@echo Doing: 'cmake --build . --config release --target INSTALL'
@echo Doing: 'cmake --build . --config release --target INSTALL' >> %TMPLOG%
@cmake --build . --config release --target INSTALL >> %TMPLOG% 2>&1
@fa4 " -- " %TMPLOG%
@echo Done build and install of %TMPPRJ%...
@goto END
:GOTNO
@echo.
@echo No install at this time, but there may be an updexe.bat to copy the EXE to c:\MDOS...
@echo.
@goto END
:NOBAT
@echo Can NOT locate MSVC setup batch "%SET_BAT%"! *** FIX ME ***
@goto ISERR
@REM :NOROOT
@REM @echo Can NOT locate %TMPROOT%! *** FIX ME ***
@REM @goto ISERR
:NOCM
@echo Can NOT locate %TMPSRC%\CMakeLists.txt! *** FIX ME ***
@goto ISERR
:NOINST
@echo Can NOT locate directory %TMPINST%! *** FIX ME ***
@goto ISERR
:ERR0
@echo MSVC 10 setup error
@goto ISERR
:ERR1
@echo cmake config, generation error
@goto ISERR
:ERR2
@echo debug build error
@goto ISERR
:ERR3
@fa4 "mt.exe : general error c101008d:" %TMPLOG% >nul
@if ERRORLEVEL 1 goto ERR32
:ERR33
@echo release build error
@goto ISERR
:ERR32
@echo Stupid error... trying again...
@echo Doing: 'cmake --build . --config release'
@echo Doing: 'cmake --build . --config release' >> %TMPLOG%
@cmake --build . --config release >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR33
@goto DNREL
:BADBR
@call git checkout %TMPBR%
@call chkbranch %TMPBR%
@if ERRORLEVEL 1 goto BADBR2
@goto GOTBR
:BADBR2
@call shwbranch
@echo Not on correct branch %TMPBR%
@goto ISERR
:ISERR
@endlocal
@exit /b 1
:END
@endlocal
@exit /b 0
@REM eof

View File

@ -1,83 +1,87 @@
@setlocal
@set TMPVER=1
@set TMPPRJ=tidy
@echo Build %TMPPRJ% project, in 64-bits
@set TMPSRC=..\..
@set TMPBGN=%TIME%
@set TMPINS=D:\Projects\3rdParty.x64
@set TMPLOG=bldlog-1.txt
@set BLDDIR=%CD%
@set TMPROOT=F:\Projects
@set SET_BAT=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
@if NOT EXIST "%SET_BAT%" goto NOBAT
@if NOT EXIST %TMPROOT%\nul goto NOROOT
@set TMPSRC=%TMPROOT%\tidy-html5
@if NOT EXIST %TMPSRC%\CMakeLists.txt goto NOCM
@set DOPAUSE=1
@set TMPGEN=Visual Studio 16 2019
@set TMPBR=next
@set TMPINDBG=1
@if /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" (
@set TMPINST=%TMPROOT%\software.x64
) ELSE (
@if /I "%PROCESSOR_ARCHITECTURE%" EQU "x86_64" (
@set TMPINST=%TMPROOT%\software.x64
) ELSE (
@echo ERROR: Appears 64-bit is NOT available... aborting...
@goto ISERR
)
)
@if NOT EXIST %TMPINST%\nul goto NOINST
@echo Doing build output to %TMPLOG%
@echo Doing build output to %TMPLOG% > %TMPLOG%
@echo Doing: 'call "%SET_BAT%" %PROCESSOR_ARCHITECTURE%'
@echo Doing: 'call "%SET_BAT%" %PROCESSOR_ARCHITECTURE%' >> %TMPLOG%
@call "%SET_BAT%" %PROCESSOR_ARCHITECTURE% >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR0
@REM call setupqt64
@cd %BLDDIR%
:DNARCH
@REM ############################################
@REM NOTE: SPECIAL INSTALL LOCATION
@REM Adjust to suit your environment
@REM ##########################################
@REM set TMPINST=F:\Projects\software.x64
@set TMPOPTS=-DCMAKE_INSTALL_PREFIX=%TMPINST%
@set TMPOPTS=%TMPOPTS% -G "Visual Studio 10 Win64"
@REM set TMPOPTS=%TMPOPTS% -DTIDY_CONFIG_FILE="C:\MDOS\tidy5.cfg"
@REM set TMPOPTS=%TMPOPTS% -DTIDY_USER_CONFIG_FILE="C:\MDOS\tidy5.cfg"
@set TMPOPTS=-G "%TMPGEN%" -A x64
@set TMPOPTS=%TMPOPTS% -DCMAKE_INSTALL_PREFIX=%TMPINS%
@set TMPOPTS=%TMPOPTS% -DBUILD_SHARED_LIB=ON
:RPT
@if "%~1x" == "x" goto GOTCMD
@set TMPOPTS=%TMPOPTS% %1
@if "%~1x" == "NOPAUSEx" (
@set DOPAUSE=0
) else (
@set TMPOPTS=%TMPOPTS% %1
)
@shift
@goto RPT
:GOTCMD
@call chkmsvc %TMPPRJ%
@if "%TMPBR%x" == "x" goto DNBR
@call chkbranch %TMPBR%
@if ERRORLEVEL 1 goto BAD_BR
:DNBR
@echo Begin %DATE% %TIME%, output to %TMPLOG%
@echo Begin %DATE% %TIME% >> %TMPLOG%
@echo Build %TMPPRJ% 64-bits %DATE% %TIME%, in %CD%, to %TMPLOG% > %TMPLOG%
@echo Doing: 'cmake %TMPSRC% %TMPOPTS%'
@echo Doing: 'cmake %TMPSRC% %TMPOPTS%' >> %TMPLOG%
@cmake %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1
@if NOT EXIST %TMPSRC%\nul goto NOSRC
@echo Build source %TMPSRC%... all output to build log %TMPLOG%
@echo Build source %TMPSRC%... all output to build log %TMPLOG% >> %TMPLOG%
@if EXIST build-cmake.bat (
@call build-cmake >> %TMPLOG%
)
@if NOT EXIST %TMPSRC%\CMakeLists.txt goto NOCM
@echo Doing: 'cmake -S %TMPSRC% %TMPOPTS%'
@echo Doing: 'cmake -S %TMPSRC% %TMPOPTS%' >> %TMPLOG% 2>&1
@cmake -S %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR1
@echo Doing: 'cmake --build . --config debug'
@echo Doing: 'cmake --build . --config debug' >> %TMPLOG%
@cmake --build . --config debug >> %TMPLOG%
@echo Doing: 'cmake --build . --config Debug'
@echo Doing: 'cmake --build . --config Debug' >> %TMPLOG% 2>&1
@cmake --build . --config Debug >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR2
@echo Doing: 'cmake --build . --config release'
@echo Doing: 'cmake --build . --config release' >> %TMPLOG%
@cmake --build . --config release >> %TMPLOG% 2>&1
@echo Doing: 'cmake --build . --config Release'
@echo Doing: 'cmake --build . --config Release' >> %TMPLOG% 2>&1
@cmake --build . --config Release >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR3
:DNREL
@echo Appears a successful build
@fa4 "***" %TMPLOG%
@call elapsed %TMPBGN%
@echo Appears a successful build... see %TMPLOG%
@echo Note install location %TMPINS%
@if "%TMPINDBG%x" == "1x" (
@echo Will install Debug and Release
) else (
@echo Will only install Release
)
@echo.
@REM echo No INSTALL configured at this time
@REM goto END
@echo Note install location %TMPINST%
@REM ##############################################
@REM Check if should continue with install
@REM ##############################################
@if "%DOPAUSE%x" == "0x" goto DOINST
@choice /? >nul 2>&1
@if ERRORLEVEL 1 goto NOCHOICE
@choice /D N /T 10 /M "Pausing for 10 seconds. Def=N"
@if ERRORLEVEL 2 goto GOTNO
@goto DOINST
:NOCHOICE
@echo Appears OS does not have the 'choice' command!
@ask *** CONTINUE with install? *** Only y continues
@if ERRORLEVEL 2 goto NOASK
@if ERRORLEVEL 1 goto DOINST
@ -85,69 +89,99 @@
@echo.
@goto END
:NOASK
@echo ask not found in path...
@echo *** CONTINUE with install? *** Only y continues
@echo 'ask' utility not found in path...
@echo.
@echo *** CONTINUE with install? *** Only Ctrl+c aborts...
@echo.
@pause
:DOINST
@REM cmake -P cmake_install.cmake
@echo Doing: 'cmake --build . --config debug --target INSTALL'
@echo Doing: 'cmake --build . --config debug --target INSTALL' >> %TMPLOG%
@cmake --build . --config debug --target INSTALL >> %TMPLOG% 2>&1
@echo Proceeding with INSTALL...
@echo.
@if NOT "%TMPINDBG%x" == "1x" goto DNDBGIN
@if EXIST install_manifest.txt @del install_manifest.txt
@echo Doing: 'cmake --build . --config Debug --target INSTALL'
@echo Doing: 'cmake --build . --config Debug --target INSTALL' >> %TMPLOG% 2>&1
@cmake --build . --config Debug --target INSTALL >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR4
@if EXIST install_manifest.txt (
@copy install_manifest.txt install_manifest_debug.txt >nul
@call add2installs install_manifest.txt -o %TMPINS%\install_manifest.txt >> %TMPLOG%
)
:DNDBGIN
@echo Doing: 'cmake --build . --config release --target INSTALL'
@echo Doing: 'cmake --build . --config release --target INSTALL' >> %TMPLOG%
@cmake --build . --config release --target INSTALL >> %TMPLOG% 2>&1
@if EXIST install_manifest.txt @del install_manifest.txt
@echo Doing: 'cmake --build . --config Release --target INSTALL'
@echo Doing: 'cmake --build . --config Release --target INSTALL' >> %TMPLOG% 2>&1
@cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR5
@if EXIST install_manifest.txt (
@copy install_manifest.txt install_manifest_release.txt >nul
@call add2installs install_manifest.txt -o %TMPINS%\install_manifest.txt >> %TMPLOG%
)
@fa4 " -- " %TMPLOG%
@echo Done build and install of %TMPPRJ%...
@call elapsed %TMPBGN%
@echo All done... see %TMPLOG%
@goto END
:NOBAT
@echo Can NOT locate MSVC setup batch "%SET_BAT%"! *** FIX ME ***
:BAD_BR
@echo Try to do 'git checkout %TMPBR%'
@git checkout %TMPBR% >> %TMPLOG% 2>&1
@call chkbranch %TMPBR%
@if ERRORLEVEL 1 goto NO_BR
@goto DNBR
:NO_BR
@echo.
@echo Unable to check out %TMPBR%! *** FIX ME ***
@echo.
@goto ISERR
:NOROOT
@echo Can NOT locate %TMPROOT%! *** FIX ME ***
:GOTNO
@echo.
@echo No install at this time, but there may be an updexe.bat to copy the EXE to c:\MDOS...
@echo.
@goto END
:NOSRC
@echo Can NOT locate source %TMPSRC%! *** FIX ME ***
@echo Can NOT locate source %TMPSRC%! *** FIX ME *** >> %TMPLOG%
@goto ISERR
:NOCM
@echo Can NOT locate %TMPSRC%\CMakeLists.txt! *** FIX ME ***
@goto ISERR
:NOINST
@echo Can NOT locate directory %TMPINST%! *** FIX ME ***
@goto ISERR
:ERR0
@echo MSVC 10 setup error
@echo Can NOT locate %TMPSRC%\CMakeLists.txt!
@echo Can NOT locate %TMPSRC%\CMakeLists.txt! >> %TMPLOG%
@goto ISERR
:ERR1
@echo cmake config, generation error
@echo cmake configuration or generations ERROR
@echo cmake configuration or generations ERROR >> %TMPLOG%
@goto ISERR
:ERR2
@echo debug build error
@echo ERROR: Cmake build Debug FAILED!
@echo ERROR: Cmake build Debug FAILED! >> %TMPLOG%
@goto ISERR
:ERR3
@fa4 "mt.exe : general error c101008d:" %TMPLOG% >nul
@if ERRORLEVEL 1 goto ERR32
:ERR33
@echo release build error
@echo ERROR: Cmake build Release FAILED!
@echo ERROR: Cmake build Release FAILED! >> %TMPLOG%
@goto ISERR
:ERR4
@echo ERROR: Install Debug FAILED!
@echo ERROR: Install Debug FAILED! >> %TMPLOG%
@goto ISERR
:ERR5
@echo ERROR: Install Release FAILED!
@echo ERROR: Install Release FAILED! >> %TMPLOG%
@goto ISERR
:ERR32
@echo Stupid error... trying again...
@echo Doing: 'cmake --build . --config release'
@echo Doing: 'cmake --build . --config release' >> %TMPLOG%
@cmake --build . --config release >> %TMPLOG% 2>&1
@if ERRORLEVEL 1 goto ERR33
@goto DNREL
:ISERR
@echo See %TMPLOG% for details...
@endlocal
@exit /b 1

93
build/win64/gen-html.bat Normal file
View File

@ -0,0 +1,93 @@
@setlocal
@REM Build HTML from log of 'version.txt'
@REM Versify the tools used
@call verhist -? >nul
@if ERRORLEVEL 1 (
@echo Unable to run 'verhist.pl'! *** FIX ME ***
@exit /b 1
)
@call emailobfuscate -? >nul
@if ERRORLEVEL 1 (
@echo Unable to run 'emailobfuscate.pl'! *** FIX ME ***
@exit /b 1
)
@set TMPFIL1=..\..\version.txt
@if NOT EXIST %TMPFIL1% (
@echo Can NOT locate %TMPFIL1%, in %CD% - *** FIX ME ***
@exit /b 1
)
@call dirmin %TMPFIL1%
@set /P TMPVER=<%TMPFIL1%
@echo Current version '%TMPVER%' ...
@set TMPLOG1=..\..\..\temp-%TMPVER%.log
@set TMPLOG2=..\..\..\temp2-%TMPVER%.log
@set TMPLOG3=..\..\..\temp3-%TMPVER%.log
@if EXIST %TMPLOG1% goto GOTL1
@call git log -p %TMPFIL1% > %TMPLOG1%
@if NOT EXIST %TMPLOG1% (
@echo Gen of %TMPLOG1% FAILED! *** FIX ME ***
@exit /b 1
)
:GOTL1
@echo Got log 1 '%TMPLOG1%' ...
@call dirmin %TMPLOG1%
@if EXIST %TMPLOG2% goto GOTL2
@call verhist %TMPLOG1% -o %TMPLOG2%
@if EXIST %TMPLOG2% goto GOTL2
@echo Gen of %TMPLOG2% FAILED! *** FIX ME ***
@exit /b 1
:GOTL2
@echo Got log 2 '%TMPLOG2%' ...
@call dirmin %TMPLOG2%
@set TMPV=%1
@if "%TMPV%x" == "x" (
@echo Give the cut-off version, like 5.6.0, to continue..
@exit /b 1
)
@echo Doing: 'call grep %TMPV% %TMPLOG2%' ...
@call grep %TMPV% %TMPLOG2%
@if ERRORLEVEL 1 (
@echo Failed to find '%TMPV%'... check the file '%TMPLOG2%'
@exit /b 1
)
@set TMPD=%~2
@if "%TMPD%x" == "x" (
@echo Give the DATE of the cut-off, like 'Sat Nov 25 14:50:00 2017 +0100', to continue...
@exit /b 1
)
@if EXIST %TMPLOG3% goto GOTL3
@call git log "--decorate=full" "--since=%TMPD%" > %TMPLOG3%
@if EXIST %TMPLOG3% goto GOTL3
@echo Failed to generate 'git log ...' - *** FIX ME ***
@exit /b 1
:GOTL3
@echo Got log 3 '%TMPLOG3%' ...
@call dirmin %TMPLOG3%
@REM at last generate the release HTML
@set TMPHTM=..\..\..\temp-%TMPVER%.html
@if EXIST %TMPHTM% goto GOTL4
@call emailobfuscate %TMPLOG3% -o %TMPHTM% -a %TMPVER% -i
@if EXIST %TMPHTM% goto GOTL4
@echo FAILED to generate %TMPHTM%! *** FIX ME ***
@exit /b 1
:GOTL4
@echo Got HTML '%TMPHTM%' ...
@call dirmin %TMPHTM%
@REM All success - check image
@call start %TMPHTM%
@REM eof

View File

@ -1,4 +1,5 @@
@setlocal
@set TMPWV=win64
@set TMPSRC=../..
@set TMPNAME=tidy
@set TMPFIL=%TMPSRC%\version.txt
@ -21,17 +22,26 @@
@set DOPAUSE=echo No pause requested...
)
@set TMPFIL1=%TMPNAME%-%TMPVER%-win64.exe
@set TMPFIL2=%TMPNAME%-%TMPVER%-win64.msi
@set TMPFIL3=%TMPNAME%-%TMPVER%-win64.zip
@if NOT EXIST %TMPFIL1% goto NOFIL1
@if NOT EXIST %TMPFIL2% goto NOFIL2
@if NOT EXIST %TMPFIL3% goto NOFIL3
@echo.
@echo Will publish...
@set TMPCNT=0
@set TMPFIL1=%TMPNAME%-%TMPVER%-%TMPWV%.exe
@set TMPFIL2=%TMPNAME%-%TMPVER%-%TMPWV%.msi
@set TMPFIL3=%TMPNAME%-%TMPVER%-%TMPWV%.zip
@if EXIST %TMPFIL1% (
@echo %TMPFIL1%
@set /A TMPCNT+=1
)
@if EXIST %TMPFIL2% (
@echo %TMPFIL2%
@set /A TMPCNT+=1
)
@if EXIST %TMPFIL3% (
@echo %TMPFIL3%
@set /A TMPCNT+=1
)
@if "%TMPCNT%x" == "0x" goto NOPUB
@echo.
@echo Will publish %TMPCNT% files to %TMPDD%
@echo.
@echo *** CONTINUE?%
@%DOPAUSE%
@ -41,18 +51,25 @@
@if NOT EXIST %TMPDD%\nul goto NODST
)
@if EXIST %TMPFIL1% (
@set TMPSRC=%TMPFIL1%
@set TMPDST=%TMPDD%\%TMPFIL1%
@call :CHKCOPY
)
@if EXIST %TMPFIL2% (
@set TMPSRC=%TMPFIL2%
@set TMPDST=%TMPDD%\%TMPFIL2%
@call :CHKCOPY
)
@if EXIST %TMPFIL3% (
@set TMPSRC=%TMPFIL3%
@set TMPDST=%TMPDD%\%TMPFIL3%
@call :CHKCOPY
)
@echo.
@echo Maybe time to run 'gentidyyml %TMPBIN%'
@echo If done all bins, WIN32, WIN64, linux, ... maybe time to run 'gentidyyml %TMPBIN%'
@echo.
@goto END
@ -88,16 +105,14 @@ copy %TMPSRC% %TMPDST%
:NODST
@echo Error: Unable to create %TMPDD%
@goto END
:NOPUB
@echo Appears no files to PUBLISH!
:NOFIL1
@echo Can NOT locate %TMPFIL1%! *** FIX ME ***
@goto END
:NOFIL2
@echo Can NOT locate %TMPFIL2%! *** FIX ME ***
@goto END
:NOFIL3
@echo Can NOT locate %TMPFIL3%! *** FIX ME ***
@goto END

18
console/Info.plist.in Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>HTML Tidy</string>
<key>CFBundleIdentifier</key>
<string>org.htacg.html-tidy.tidy5</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>@LIBTIDY_VERSION@</string>
<key>CFBundleVersion</key>
<string>@LIBTIDY_DATE@</string>
<key>NSHumanReadableCopyright</key>
<string>©@CURRENT_YEAR@ HTACG and Contributors</string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@ -1,198 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.9.1 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title="Tidy Home"/>
<tab type="pages" visible="yes" title="Pages" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
<tab type="user" url="https://github.com/htacg/tidy-html5/issues" title="Bugs &amp; Issues"/>
<tab type="user" url="https://github.com/htacg/tidy-html5" title="github"/>
<tab type="user" url="http://www.htacg.org/" title="htacg.org"/>
<tab type="user" url="http://www.html-tidy.org/" title="html-tidy.org"/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -1,6 +0,0 @@
Documentation
=============
This directory does _not_ contain documentation for HTML Tidy. It consists of files used for generating documentation for HTML Tidy.
Please consult the main README file for more information.

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +0,0 @@
#include <tidy.h>;
#include <tidybuffio.h>;
#include <stdio.h>;
#include <errno.h>;
int main(int argc, char **argv )
{
const char* input = "<title>Hello</title><p>World!";
TidyBuffer output = {0};
TidyBuffer errbuf = {0};
int rc = -1;
Bool ok;
// Initialize "document"
TidyDoc tdoc = tidyCreate();
printf( "Tidying:\t%s\n", input );
// Convert to XHTML
ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes );
if ( ok )
rc = tidySetErrorBuffer( tdoc, &errbuf ); // Capture diagnostics
if ( rc >= 0 )
rc = tidyParseString( tdoc, input ); // Parse the input
if ( rc >= 0 )
rc = tidyCleanAndRepair( tdoc ); // Tidy it up!
if ( rc >= 0 )
rc = tidyRunDiagnostics( tdoc ); // Kvetch
if ( rc > 1 ) // If error, force output.
rc = ( tidyOptSetBool(tdoc, TidyForceOutput, yes) ? rc : -1 );
if ( rc >= 0 )
rc = tidySaveBuffer( tdoc, &output ); // Pretty Print
if ( rc >= 0 )
{
if ( rc > 0 )
printf( "\nDiagnostics:\n\n%s", errbuf.bp );
printf( "\nAnd here is the result:\n\n%s", output.bp );
}
else
printf( "A severe error (%d) occurred.\n", rc );
tidyBufFree( &output );
tidyBufFree( &errbuf );
tidyRelease( tdoc );
return rc;
}

View File

@ -1,22 +0,0 @@
// sample config file for HTML tidy
indent: auto
indent-spaces: 2
wrap: 72
markup: yes
output-xml: no
input-xml: no
show-warnings: yes
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: latin1
new-inline-tags: cfif, cfelse, math, mroot,
mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
munder, mover, mmultiscripts, msup, msub, mtext,
mprescripts, mtable, mtr, mtd, mth
new-blocklevel-tags: cfoutput, cfquery
new-empty-tags: cfelse

View File

@ -1,52 +0,0 @@
/*!
\mainpage Tidy home
\note The repository <a href="https://github.com/htacg/tidy-html5">github.com/htacg/tidy-html5</a> and this documentation should be considered canonical for HTML Tidy as of 2015-January-15. See \ref history
\b Tidy corrects and cleans up HTML content by fixing markup errors such as mismatched, misnested and missing tags, missing end "/" tags, missing quotations et all, eg:
\code{.html}
<h1><hr>heading</h1>
<h2>sub<hr>heading</h2>
<a href="#refs">References<a>
\endcode
is converted to
\code{.html}
<hr>
<h1>heading</h1>
<h2>sub</h2>
<hr>
<h2>heading</h2>
<a href="#refs">References</a>
\endcode
<h4>This project has two parts:</h4>
- \ref tidylib
- a C static or dynamic library that developers can integrate into their applications
in order to bring all of Tidys power to your favorite tools.
- \ref tidy_cmd
- a console application built on \ref tidylib for Mac OS X, Linux, Windows, UNIX, and more.
\section content Contents
- \ref quick_ref
- \ref tidy_cmd
- \ref tidy_quickstart
- \ref tidy_config
- \ref featured_options
- \ref tidy_scripting
- \ref tidylib
- <a href="modules.html">Modules</a>
- \ref building_tidy
-\ref docs_howto
- \subpage history
- \subpage license
- \ref todo
*/

View File

@ -1,98 +0,0 @@
/*!
\page building_tidy Building Tidy
How to compile and install Tidy from source code.
\tableofcontents
\section Prerequisites
- \b git - <a href="http://git-scm.com/book/en/v2/Getting-Started-Installing-Git">git-scm.com/book/en/v2/Getting-Started-Installing-Git</a>
- \b cmake - <a href="http://www.cmake.org/download/">cmake.org/download/</a>
- Appropriate build tools for the platform
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 the 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
variuous 'native' build files. Running cmake without any parameters will 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.
In windows cmake offers various versions of MSVC. Again below only the command line use of MSVC is shown, but the
tidy solution (*.sln) file can be loaded into the MSVC IDE, and the building done in there.
\section get_source Get the source code
Tidys sourcecode can be found at <a href="https://github.com/htacg/tidy-html5">github.com/htacg/tidy-html5</a>. There are sometimes
several branches, but in general `master` is the most recently updated version.
\note Note that as “cutting edge,” it may have bugs or other
unstable behavior. If you prefer a stable, officially released version, be sure to have a look
at Releases on the github page.
In general you can use the <b>Download ZIP</b> button on the github page to download the most recent version of a branch. If you prefer
Git then you can clone the repository to a working machine with:
\code{.sh}
git clone git@github.com:htacg/tidy-html5.git
\endcode
\section compile Compile
<h4>Enter the `build/cmake` directory</h4>
\code{.sh}
# *nix
cd {your-tidy-html5-directory}/build/cmake
# windows
cd {your-tidy-html5-directory}\build\cmake
\endcode
<h4>Configure the build</h4>
\code{.sh}
# *nix
cmake ../../ [-DCMAKE_INSTALL_PREFIX=/path/for/install]
# windows
cmake ..\..\
\endcode
By default cmake sets the install path to `/usr/local` in unix.
If you wanted the binary in say `/usr/bin` instead, then use `-DCMAKE_INSTALL_PREFIX=/usr`
On windows the default install is to `C:\Program Files\tidy5`, or `C:/Program Files (x86)/tidy5`, which is not very useful. After
the build the `tidy[n].exe` is in the `Release\` directory, and can be copied to any directory in your `PATH` environment variable, for global use.
If you need the tidy library built as a 'shared' (DLL) library, then in add the command `-DBUILD_SHARED_LIB:BOOL=ON`.
This option is `OFF` by default, so the static library is built and linked with the command line tool for convenience.
<h4>Compile</h4>
\code{.sh}
# *nix
make
# windows
cmake --build . --config Release
\endcode
\section compileOnstall Install
Install the applicatio and library with
\code{.sh}
# *nix
[sudo] make install
# windows
cmake --build . --config Release --target INSTALL
\endcode
*/

View File

@ -1,146 +0,0 @@
/*!
\page featured_options Featured Options
Overview of popular features and problems
\tableofcontents
\section indenting Indenting output for readability
Indenting the source markup of an HTML document makes the markup easier to read. Tidy can indent the
markup for an HTML document while recognizing elements whose contents should not be indented. In the
example below, Tidy indents the output while preserving the formatting of the `<pre>` element:
Input:
\code{.html}
<html>
<head>
<title>Test document</title>
</head>
<body>
<p>This example shows how Tidy can indent output while preserving
formatting of particular elements.</p>
<pre>This is
<em>genuine
preformatted</em>
text
</pre>
</body>
</html>
\endcode
Output:
\code{.html}
<html>
<head>
<title>Test document</title>
</head>
<body>
<p>This example shows how Tidy can indent output while preserving
formatting of particular elements.</p>
<pre>
This is
<em>genuine
preformatted</em>
text
</pre>
</body>
</html>
\endcode
Tidys indenting behavior is not perfect and can sometimes cause your output to be rendered by browsers in a different way than the input. You can
avoid unexpected indenting-related rendering problems by setting `indent:no` or `indent:auto` in a config file.
\note
<b>Preserving original indenting not possible</b><br><br>
Tidy is not capable of preserving the original indenting of the markup from the input it receives. Thats because Tidy starts by
building a clean parse tree from the input, and that parse tree doesnt contain any information about the original indenting. Tidy then
pretty-prints the parse tree using the current config settings. Trying to preserve the original
indenting from the input would interact badly with the repair operations needed to build a clean parse tree, and would considerably complicate the code.
\section encodings Encodings and character references
Tidy defaults to assuming you want output to be encoded in `UTF-8`. But Tidy offers you a choice of other
character encodings: `US ASCII`, `ISO Latin-1`, and the `ISO 2022` family of 7 bit encodings.
Tidy doesnt yet recognize the use of the HTML `<meta>` element for specifying the character encoding.
The full set of HTML character references are defined. Cleaned-up output uses named character references for characters when appropriate. Otherwise,
characters outside the normal range are output as numeric character references.
\section accessibility Accessibility
Tidy offers advice on potential accessibility problems for people using non-graphical browsers.
\section cleaning_presentational Cleaning up presentational markup
Some tools generate HTML with presentational elements such as `<font>`, `<nobr>`, and `<center>`. Tidys -clean option will replace those elements with `<style>` elements and CSS.
Some HTML documents rely on the presentational effects of `<p>` start tags that are not followed by any content. Tidy deletes
such `<p>` tags (as well as any headings that dont have content). So do not use `<p>` tags simply for
adding vertical whitespace; instead use CSS, or the `<br>` element. However, note that
Tidy wont discard `<p>` tags that are followed by any non-breaking space (that is, the \code&nbsp;\endcode named character reference).
\section new_tags Teaching Tidy about new tags
You can teach Tidy about new tags by declaring them in the configuration file, the syntax is:
\code
new-inline-tags: tag1, tag2, tag3
new-empty-tags: tag1, tag2, tag3
new-blocklevel-tags: tag1, tag2, tag3
new-pre-tags: tag1, tag2, tag3
\endcode
The same tag can be defined as \b empty and as \b inline, or as \b empty and as \b block.
These declarations can be combined to define a new empty inline or empty block element, but you are not advised to
declare tags as being both \b inline and \b block.
Note that the new tags can only appear where Tidy expects inline or block-level tags respectively. That means you cant place new
tags within the document head or other contexts with restricted content models.
\section ignoring_scripting Ignoring PHP, ASP, and JSTE instructions
Tidy will gracefully ignore many cases of PHP, ASP, and JSTE instructions within element content and as replacements for attributes,
and preserve them as-is in output; for example:
\code{.php}
<option <% if rsSchool.Fields("ID").Value
= session("sessSchoolID")
then Response.Write("selected") %>
value='<%=rsSchool.Fields("ID").Value%>'>
<%=rsSchool.Fields("Name").Value%>
(<%=rsSchool.Fields("ID").Value%>)
</option>
\endcode
But note that Tidy may report missing attributes when those are “hidden” within the PHP, ASP, or JSTE code. If you use
PHP, ASP, or JSTE code to create a start tag, but place the end tag explicitly in the HTML markup, Tidy
wont be able to match them up, and will delete the end tag. In that case you are advised to make the
start tag explicit and to use PHP, ASP, or JSTE code for just the attributes; for example:
\code{.php}
<a href="<%=random.site()%>">do you feel lucky?</a>
\endcode
Tidy can also get things wrong if the PHP, ASP, or JSTE code includes quotation marks; for example:
\code{.php}
value="<%=rsSchool.Fields("ID").Value%>"
\endcode
Tidy will see the quotation mark preceding ID as ending the attribute value, and proceed to complain about what follows.
Tidy allows you to control whether line wrapping on spaces within PHP, ASP, and JSTE instructions is
enabled; see the `wrap-php`, `wrap-asp`, and `wrap-jste` config options.
\section correcting_xml Correcting well-formedness errors in XML markup
Tidy can help you to correct well-formedness errors in XML markup. Tidy doesnt yet recognize all XML features,
though; for example, it doesnt understand CDATA sections or DTD subsets.
*/

View File

@ -1,54 +0,0 @@
/*!
\page history History
Once upon a time....
<p><strong>HTML Tidy</strong> was created by the <a href="http://www.w3.org/">W3Cs</a> own <a href="http://www.w3.org/People/Raggett/">Dave Raggett</a> back in the
dawn of the Internet age. His original Internet page is still available and
gives a sense of the early history: <a href="http://www.w3.org/People/Raggett/tidy/">Clean up your Web pages with HTML TIDY</a>.</p>
<p>Satisfied with his work Dave passed the torch to a dedicated group of
maintainers at <a href="http://tidy.sourceforge.net/">tidy.sourceforge.net</a> where the important tasks of turning
<strong>Tidy</strong> into a C library and keeping up with developing standards was
performed.</p>
<p>W3C members took a renewed interest in <strong>Tidy</strong> in 2011 and forked the
project to <a href="https://github.com/w3c/tidy-html5">github</a> (now redirects to this project), where it featured
compatibility with HTML5 via a <a href="https://lists.w3.org/Archives/Public/www-archive/2011Nov/0007.html">key contribution</a> from one of the SourceForge
key members.</p>
<p>In 2015 a group of concerned developers, users, and software integrators formed
<a href="http://www.htacg.org">HTACG</a> with the goal of revitalizing <strong>Tidy</strong>, which had fallen into a
non-maintained state. As a W3C Community Group, HTACG was deemed worthy by the
W3C, and W3C passed ownership of their project to HTACG, where it is currently
being developed and prepped for a new, stable, and modern release.</p>
<p>HTACG is also working diligently with the SourceForge maintainers in an effort
to harmonize <strong>HTML Tidy</strong> into a single, stable, solid release once again.</p>
\code
+-----------------------------+
|w3.org/People/Raggett/tidy/|
++-------------+--------------+
||
||+----------------------+
|+-->|tidy.sourceforge.net|
|+------------------+---+
||
|+--------------------+------+|Soon
+-->|github.com/w3c/tidy|html5||
+-+------------------+------+|
||
||+-------------------------------+
|+->|Youarehere:|
||github.com/htacg/tidy-html5|
+----------------------------->+----------------------+--------+
\endcode
*/

View File

@ -1,14 +0,0 @@
/*!
\page license License
License and Legal
<pre>
\htmlinclude LICENSE.md
</pre>
*/

View File

@ -1,12 +0,0 @@
/*!
\page quick_ref Quick Ref
Quick reference generated from the tidy command
\htmlinclude quickref_include.html
*/

View File

@ -1,18 +0,0 @@
/*!
Running the tidy command
\page tidy_cmd tidy command
- \subpage tidy_quickstart
- \subpage tidy_config
- \subpage featured_options
- \subpage tidy_scripting
<pre>
\htmlinclude tidy5.help.txt
</pre>
*/

View File

@ -1,46 +0,0 @@
/*!
\page tidy_config Configuration
Configuration settings and files
\tableofcontents
To get a list of all configuration settings, see \ref config_options below or use:
\code{.sh}
tidy -help-config
\endcode
\section using_config Using a configuration file
The most convenient way to configure Tidy is by using separate configuration file.
Assuming you have created a Tidy configuration file named `myconfig.txt` (the name and extension dont matter), you can instruct Tidy to use it via the
command line option `-config myconfig.txt` for example:
\code {.sh}
tidy -config myconfig.txt file1.html file2.html
\endcode
Alternatively, you can name the default config file via the environment
variable named `HTML_TIDY`, the value of which is the absolute path for the config file.
You can also set config options on the command line by preceding the name of the option
immediately (no intervening space) with the string “--”; for example:
\code {.sh}
tidy --break-before-br true --show-warnings false
\endcode
You can find documentation for full set of configuration options on the \ref quick_ref page.
\section example_config Example Configuration File
\include example_config.txt
\section config_options Config Options
<pre>
\htmlinclude tidy5.config.txt
</pre>
*/

View File

@ -1,71 +0,0 @@
/*!
\page tidy_quickstart tidy command quickstart
\tableofcontents
This is the syntax for invoking Tidy from the command line:
\code{.sh}
tidy [[options] filename]
\endcode
Tidy defaults to reading from standard input, so if you run Tidy without specifying the filename argument, it will just sit there waiting for input to read.
Tidy defaults to writing to standard output. So you can pipe output from Tidy to other programs, as well as pipe output from other programs to Tidy. You can page through the output from Tidy by piping it to a pager, e.g.:
\code{.sh}
tidy file.html | less
\endcode
\section out_file Output to file
To have Tidy write its output to a file instead, either use the
\code{.sh}
-o filename
or
-output filename
\endcode
option, or redirect standard output to the file. For example:
\code{.sh}
tidy -o output.html index.html
tidy -output output.html index.html
tidy index.html > output.html
\endcode
All the above run Tidy on the file `index.html` and write the output to the file `output.html`, while writing any error messages to standard error.
\section out_error Error output
Tidy defaults to writing its error messages to standard error (that is, to the console where youre running Tidy). To page through the error messages along with the
output, redirect standard error to standard output, and pipe it to your pager:
\code{.sh}
tidy index.html 2>&1 | less
\endcode
To have Tidy write the errors to a file instead, either use
\code{.sh}
-f filename
or
-file filename
\endcode
option, or redirect standard error to a file:
\code{.sh}
tidy -o output.html -f errs.txt index.html
tidy index.html > output.html 2> errs.txt
\endcode
Both the above run Tidy on the file `index.html` and writes the output to the file `output.html`, while writing any error messages to the `file errs.txt`.
Writing the error messages to a file is especially useful if the file you are checking has many errors; reading them from a file instead of the console
or pager can make it easier to review them.
\section out_modify Modify / Overwrite
You can use the or `-m` or `-modify` option to modify (in-place) the contents of the input file you are checking; that is, to overwrite those contents with the output from Tidy. For example:
\code{.sh}
tidy -f errs.txt -m index.html
\endcode
That runs Tidy on the file `index.html`, modifying it in place and writing the error messages to the file `errs.txt`.
\warning If you use the `-m` option, you should first ensure that you have a backup copy of your file.
*/

View File

@ -1,31 +0,0 @@
/*!
\page tidy_scripting Running tidy in scripts
If you want to run Tidy from a Perl, bash, or other scripting language you may find it of value to inspect the result returned
by Tidy when it exits:
- \b 0 = if everything is fine
- \b 1 = if there were warnings and
- \b 2 = if there were errors.
\section perl_example_script Example Perl script
\code{.pl}
if (close(TIDY) == 0) {
my $exitcode = $? &gt;&gt; 8;
if ($exitcode == 1) {
printf STDERR "tidy issued warning messages\n";
} elsif ($exitcode == 2) {
printf STDERR "tidy issued error messages\n";
} else {
die "tidy exited with code: $exitcode\n";
}
} else {
printf STDERR "tidy detected no errors\n";
}
\endcode
*/

View File

@ -1,53 +0,0 @@
/*!
\page tidylib tidylib
About the tidylib C library and code
\tableofcontents
\section about_tidylib TidyLib features
- easy to integrate. Because of the near universal adoption of C linkage, a C interface may be called from a great number of programming languages.
- designed to use opaque types in the public interface. This allows the application to just pass an integer around and the need to transform data types in different languages is minimized. As a results its straight-forward to write very thin library wrappers for C++, Pascal, and COM/ATL.
- eats its own dogfood. HTML Tidy links directly to TidyLib.
- is Thread Safe and Re-entrant. Because there are many uses for HTML Tidy - from content validation, content scraping, conversion to XHTML - it was important to make TidyLib run reasonably well within server applications as well as client side.
- uses adaptable I/O. As part of the larger integration strategy it was decided to fully abstract all I/O. This means a (relatively) clean separation between character encoding processing and shovelling bytes back and forth. Internally, the library reads from sources and writes to sinks. This abstraction is used for both markup and configuration “files”. Concrete implementations are provided for file and memory I/O, and new sources and sinks may be provided via the public interface.
\section return_code Return codes
Its important to understand that API functions that return an integer almost universally adhere to the following convention:
- \b 0 == \b Success
- Good to go.
- \b 1 == \b Warnings, but no errors
- Check the error buffer or track error messages for details.
- \b 2 == \b Errors (and maybe warnings)
- By default, Tidy will not produce output. You can force output with the TidyForceOutput option. As with warnings, check error buffer or track error messages for details.
- <b>< 0</b> == <b>Severe error</b>
- Usually value equals `-errno`. See errno.h.
Also, by default, warning and error messages are sent to stderr. You can redirect diagnostic
output using either tidySetErrorFile() or tidySetErrorBuffer(). See tidy.h for details.
\section app_notes Application Notes
Of course, there are functions to parse and save both markup and configuration files. For the adventurous, it is possible to create new input sources and output sinks. For example, a URL source could pull the markup from a given URL.
It is also worth remembering that an application may instantiate any number of document and buffer objects. They are fairly cheap to initialize and destroy (just memory allocation and zeroing, really), so they may be created and destroyed locally, as needed. There is no problem keeping them around a while for keeping state. For example, a server app might keep a global document as a master configuration. As documents are parsed, they can copy their configuration data from the master instance. See tidyOptCopyConfig(). If the master copy is initialized at startup, no synchronization is necessary.
\section example_hello tidylib example
\include example.1.c
*/

View File

@ -1,14 +0,0 @@
/*!
\page todo Todo List
The todo list.
\note If this page is empty, then there are no todo items flagged in source.
\xrefitem todo "Todo" "Todo List"
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,244 +0,0 @@
<?xml version="1.0"?>
<!--
For generating the `quickref.html` web page from output of
`tidy -xml-config`
(c) 2005 (W3C) MIT, ERCIM, Keio University
See tidy.h for the copyright notice.
Written by Charles Reitzel and Jelks Cabaniss
-->
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
encoding="us-ascii"
omit-xml-declaration="yes"
/>
<xsl:template match="/">
<a name="qtop"></a>
<h2 id="top">Option Groups</h2>
<ul>
<li><a class="h3" href="#MarkupHeader">HTML, XHTML, XML</a></li>
<li><a class="h3" href="#DiagnosticsHeader">Diagnostics</a></li>
<li><a class="h3" href="#PrettyPrintHeader">Pretty Print</a></li>
<li><a class="h3" href="#EncodingHeader">Character Encoding</a></li>
<li><a class="h3" href="#MiscellaneousHeader">Miscellaneous</a></li>
</ul>
<xsl:call-template name="link-section" />
<xsl:call-template name="detail-section" />
</xsl:template>
<!-- Named Templates: -->
<xsl:template name="link-section">
<table summary="Tidy Options Quick Reference Header Section" border="0"
cellpadding="3" cellspacing="0" class="quickref">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<xsl:call-template name="links">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousHeader</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="detail-section">
<table summary="Tidy Options Quick Reference Detail Section" border="0"
cellpadding="3" cellspacing="0">
<xsl:call-template name="reference">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousReference</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="links">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr valign="bottom">
<td class="h3" colspan="2" id="{$headerID}">
<xsl:value-of select="$header"/> Options</td>
<td valign="top" class="h3top"><a href="#qtop" class="h3topa">Top</a></td>
</tr>
<xsl:call-template name="ClassHeaders" />
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td class="qrow"><a href="#{name}"><xsl:value-of select="name"/></a></td>
<td class="qrow"><xsl:apply-templates select="type"/></td>
<td class="qrow"><xsl:choose>
<xsl:when test="string-length(default) &gt; 0 ">
<xsl:apply-templates select="default" />
</xsl:when>
<xsl:otherwise>
<strong>-</strong>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr valign="bottom">
<td colspan="3">&#160;</td>
</tr>
</xsl:template>
<xsl:template name="reference">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr>
<td colspan="3">&#160;</td>
</tr>
<tr valign="bottom">
<td valign="top" colspan="3" class="h2" id="{$headerID}">
<h2 class="qh2"><xsl:value-of select="$header"/></h2>
</td>
</tr>
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td valign="top" id="{name}" colspan="2" class="qoptiontitletd">
<h4 class="qoptiontitle"><xsl:value-of select="name"/></h4>
</td>
<td class="tabletitlelink" valign="top" align="right">
<a href="#qtop">Top</a>
</td>
</tr>
<tr>
<td valign="top" class="qlabel">Type:</td>
<td class="qvalu"><xsl:value-of select="type"/></td>
</tr>
<tr>
<td valign="top" class="qlabel">Default:</td>
<td class="qvalu">
<xsl:choose>
<xsl:when test="string-length(default) &gt; 0">
<xsl:apply-templates select="default" />
</xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td valign="top" class="qlabel">Example:</td>
<td class="qvalu">
<xsl:choose>
<xsl:when test="string-length(example) &gt; 0">
<xsl:apply-templates select="example"/>
</xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<xsl:choose>
<xsl:when test="seealso">
<tr>
<td valign="top" class="qlabel">See Also:</td>
<td valign="top" class="qvalu">
<xsl:for-each select="seealso">
<a href="#{.}"><xsl:apply-templates select="." /></a>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:when>
</xsl:choose>
<tr>
<td></td>
<td colspan="1" class="qdescription"><xsl:apply-templates select="description"/></td>
</tr>
<tr>
<td>&#160;</td>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template name="ClassHeaders">
<tr>
<td class="tabletitle">Option</td>
<td class="tabletitle">Type</td>
<td class="tabletitle">Default</td>
</tr>
</xsl:template>
<xsl:template name="Stylesheet">
<style type="text/css">
/* no style */
</style>
</xsl:template>
<!-- Regular Templates: -->
<xsl:template match="a | code | em | strong | br">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@* | node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,574 +0,0 @@
<?xml version="1.0"?>
<!--
For generating the `quickref.html` web page from output of
`tidy -xml-config`
(c) 2005 (W3C) MIT, ERCIM, Keio University
See tidy.h for the copyright notice.
Written by Charles Reitzel and Jelks Cabaniss
-->
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
encoding="us-ascii"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
<xsl:template match="/">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML Tidy Configuration Options Quick Reference</title>
<xsl:call-template name="Stylesheet" />
</head>
<body>
<h1 id="top">Quick Reference</h1>
<h2>HTML Tidy Configuration Options</h2>
<p>Version: <xsl:value-of select="config/@version" /></p>
<p><a class="h3" href="#MarkupHeader">HTML, XHTML, XML</a><br />
<a class="h3" href="#DiagnosticsHeader">Diagnostics</a><br />
<a class="h3" href="#PrettyPrintHeader">Pretty Print</a><br />
<a class="h3" href="#EncodingHeader">Character Encoding</a><br />
<a class="h3" href="#MiscellaneousHeader">Miscellaneous</a></p>
<xsl:call-template name="link-section" />
<xsl:call-template name="detail-section" />
</body>
</html>
</xsl:template>
<!-- Named Templates: -->
<xsl:template name="link-section">
<table summary="Tidy Options Quick Reference Header Section" border="0"
cellpadding="3" cellspacing="0">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>
<xsl:call-template name="links">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingHeader</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="links">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousHeader</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="detail-section">
<table summary="Tidy Options Quick Reference Detail Section" border="0"
cellpadding="3" cellspacing="0">
<xsl:call-template name="reference">
<xsl:with-param name="class">markup</xsl:with-param>
<xsl:with-param name="header">HTML, XHTML, XML</xsl:with-param>
<xsl:with-param name="headerID">MarkupReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">diagnostics</xsl:with-param>
<xsl:with-param name="header">Diagnostics</xsl:with-param>
<xsl:with-param name="headerID">DiagnosticsReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">print</xsl:with-param>
<xsl:with-param name="header">Pretty Print</xsl:with-param>
<xsl:with-param name="headerID">PrettyPrintReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">encoding</xsl:with-param>
<xsl:with-param name="header">Character Encoding</xsl:with-param>
<xsl:with-param name="headerID">EncodingReference</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="reference">
<xsl:with-param name="class">misc</xsl:with-param>
<xsl:with-param name="header">Miscellaneous</xsl:with-param>
<xsl:with-param name="headerID">MiscellaneousReference</xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="links">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr valign="bottom">
<td class="h3" colspan="2" id="{$headerID}">
<xsl:value-of select="$header"/> Options</td>
<td valign="top"><a href="#top">Top</a></td>
</tr>
<xsl:call-template name="ClassHeaders" />
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td><a href="#{name}"><xsl:value-of select="name"/></a></td>
<td><xsl:apply-templates select="type"/></td>
<td><xsl:choose>
<xsl:when test="string-length(default) &gt; 0 ">
<xsl:apply-templates select="default" />
</xsl:when>
<xsl:otherwise>
<strong>-</strong>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr valign="bottom">
<td colspan="3">&#160;</td>
</tr>
</xsl:template>
<xsl:template name="reference">
<xsl:param name="class"/>
<xsl:param name="header"/>
<xsl:param name="headerID"/>
<tr>
<td>&#160;</td>
</tr>
<tr valign="bottom">
<td valign="top" colspan="2" class="h2" id="{$headerID}">
<xsl:value-of select="$header"/> Options Reference
</td>
</tr>
<tr>
<td>&#160;</td>
</tr>
<xsl:for-each select="/config/option[@class=$class]">
<xsl:sort select="name" order="ascending" />
<tr>
<td class="tabletitle" valign="top" id="{name}">
<xsl:value-of select="name"/>
</td>
<td class="tabletitlelink" valign="top" align="right">
<a href="#top">Top</a></td>
</tr>
<tr>
<td valign="top">Type: <strong><xsl:value-of
select="type"/></strong><br />
<xsl:choose>
<xsl:when test="string-length(default) &gt; 0">
Default: <strong><xsl:apply-templates select="default" /></strong>
</xsl:when>
<xsl:otherwise>
Default: <strong>-</strong>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(example) &gt; 0">
<br />Example: <strong><xsl:apply-templates
select="example"/></strong>
</xsl:when>
<xsl:otherwise>
<br />Example: <strong>-</strong>
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right" valign="top">
<xsl:for-each select="seealso">
<a href="#{.}"><xsl:apply-templates select="." /></a>
<xsl:if test="position() != last()">
<br />
</xsl:if>
</xsl:for-each>
</td>
</tr>
<tr>
<td colspan="2"><xsl:apply-templates select="description"/></td>
</tr>
<tr>
<td>&#160;</td>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template name="ClassHeaders">
<tr>
<td class="tabletitle">Option</td>
<td class="tabletitle">Type</td>
<td class="tabletitle">Default</td>
</tr>
</xsl:template>
<xsl:template name="Stylesheet">
<style type="text/css">
/* 1st Style ignored by Netscape */
td.dummy, font.dummy, .dummy, a:link.dummy, a:visited.dummy, a:active.dummy
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 16pt;
color: #336699;
text-decoration: none;
font-weight: normal
}
body
{
margin-left: 10%;
margin-right: 10%;
font-family: sans-serif;
background-color: #FFFFFF
}
/* Blue TITLE */
td.title, font.title, .title, a:link.title, a:visited.title, a:active.title
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 16pt;
color: #336699;
text-decoration: none;
font-weight: normal
}
/* BODY TEXT */
td.text, font.text, .text, a:link.text, a:visited.text, a:active.text
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
color: #000000;
text-decoration: none;
font-weight: normal
}
/* BOLD BODY TEXT */
td.textbold, font.textbold, .textbold, a:link.textbold, a:visited.textbold, a:active.textbold
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
color: #000000;
text-decoration: none;
font-weight: bold
}
/* BOLD BODY TEXT LINK WITH UNDERLINE*/
td.textboldlink, font.textboldlink, .textboldlink, a:link.textboldlink, a:visited.textboldlink, a:active.textboldlink
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
color: #000000;
font-weight: bold
}
/* SMALL BODY TEXT */
td.smtext, font.smtext, .smtext, a:link.smtext, a:visited.smtext, a:active.smtext
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #000000;
text-decoration: none;
font-weight: normal
}
/* SMALL BOLD BODY TEXT */
td.smtextbold, font.smtextbold, .smtextbold, a:link.smtextbold, a:visited.smtextbold, a:active.smtextbold
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #000000;
text-decoration: none;
font-weight: bold
}
/* TITLES
td.title, font.title, .title, a:link.title, a:visited.title, a:active.title
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #CC3300;
text-decoration: none;
font-weight: bold
}
*/
/* SUBTITLES */
td.subtitle, font.subtitle, .subtitle, a:link.subtitle, a:visited.subtitle, a:active.subtitle
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 11pt;
color: #000000;
text-decoration: none;
font-weight: bold
}
/* LEGAL TEXT */
td.legal, font.legal, .legal, a:link.legal, a:visited.legal, a:active.legal
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #000000;
text-decoration: none;
font-weight: normal
}
td.legallink, font.legallink, .legallink, a:link.legallink, a:visited.legallink, a:active.legallink
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 8pt;
color: #CC3300;
font-weight: normal
}
/* RED TEXT */
td.textred, font.textred, .textred, a:link.textred, a:visited.textred, a:active.textred
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #CC3300;
text-decoration: none;
font-weight: normal
}
/* RED TEXT BOLD*/
td.textredbold, font.textredbold, .textredbold, a:link.textredbold, a:visited.textredbold, a:active.textredbold
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #CC3300;
text-decoration: none;
font-weight: bold
}
/* LINKS */
td.link, font.link, .link, a:link.link, a:visited.link, a:active.link
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #3366CC;
font-weight: normal
}
td.tabletitlelink, font.tabletitlelink, .tabletitlelink, a:link.tabletitlelink, a:visited.tabletitlelink, a:active.tabletitlelink
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
background-color: #e9e9d3;
color: #000000;
}
/* TABLE TITLES */
td.tabletitle, font.tabletitle, .tabletitle, a:link.tabletitle, a:visited.tabletitle, a:active.tabletitle
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #336699;
background-color: #e9e9d3;
/* text-decoration: none; */
font-weight: bold
}
/* TABLE CELL */
td.cell, tr.cell, font.cell, .cell, a:link.cell, a:visited.cell, a:active.cell
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #000000;
font-weight: normal;
/* background-color: #e9e9d3 */
background-color: #f5f5f5
}
/* SHADED TABLE CELL */
td.shaded, tr.shaded, font.shaded, .shaded, a:link.shaded, a:visited.shaded, a:active.shaded
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #000000;
font-weight: normal;
background-color: #f5f5f5
}
/* GLOSSARY TERM */
td.term, font.term, .term, a:link.term, a:visited.term, a:active.term
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-style: normal;
color: #000000;
text-decoration: none;
font-weight: normal
}
/* ELEMENT TAGS */
ul
{
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: normal
}
li
{
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: normal
}
a:link.h1, a:visited.h1, .h1
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #0066CC
}
a:active.h1
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
font-weight: bold;
color: #0066CC
}
h1
{
margin-left: -8%;
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 12pt;
color: #0066CC
}
.h2
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 11pt;
/* font-weight: bold; */
color: #000000
}
h2
{
margin-left: -4%;
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 11pt;
/* font-weight: bold; */
color: #000000
}
A:link.h3, A:visited.h3, .h3
{ font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #000000;
font-weight: bold
}
A:active.h3
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #000000;
font-weight: bold
}
h3
{
margin-left: -4%;
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-weight: bold;
color: #000000
}
h4
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 9pt;
font-weight: bold;
color: #000000
}
.code, A:active.code, A:link.code, A:visited.code
{
font-family: "Courier New", Courier, monospace;
}
.abstract
{
font-style : italic;
}
p
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-style: normal
}
td
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
font-style: normal
}
/* LINKS */
a:link, a:active
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #3366CC;
font-weight: normal
}
a:visited
{
font-family: Arial, Helvetica, "Trebuchet MS", sans-serif;
font-size: 10pt;
color: #333366;
font-weight: normal
}
code {
/* use browser/user default for `font-family` */
font-weight: bold;
color: brown;
background: transparent;
}
</style>
</xsl:template>
<!-- Regular Templates: -->
<xsl:template match="a | code | em | strong | br">
<xsl:element name="{local-name(.)}">
<xsl:copy-of select="@* | node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,304 +0,0 @@
body {
background-color: #efefef;
}
#titlearea {
background-image: url(http://www.html-tidy.org/assets/images/green-abstract-background.jpg);
background-size: cover;
}
#projectname {
font-family: sans-serif;
font-size: 22pt;
margin: 0 0 0 0;
margin-left: 150px;
padding: 2px 0px;
color: white;
}
#projectnumber {
font-size: 12pt;
}
#projectbrief {
font-family: sans-serif;
font-size: 10pt;
color: #dddddd;
margin-left: 150px;
}
.contents h1 {
font-size: 15pt;
font-family: monospace;
color: #4D4D74;
font-weight: bold;
border-left: none;
border-top: none;
border-bottom: 2px solid #cccccc;
margin: 30px 0px 10px 0px;
padding: 5px 0 5px 10px;
}
.contents h2 {
font-size: 12pt;
font-family: monospace;
color: #4D4D74;
font-weight: bold;
border-top: none;
border-bottom: 1px solid #dddddd;
margin: 20px 20% 20px 0px;
padding: 2px 0 2px 10px;
}
.contents p {
line-height: 130%;
font-size: 11pt;
font-family: sans-serif;
margin: 10px 20% 15px 10px;
padding: 0px;
}
.contents ul{
list-style-type: disc;
font-size: 11pt;
margin: 5px 20% 5px 40px;
padding: 0px;
line-height: 140%;
}
.contents ul ul{
list-style-type: circle;
margin-left: 30px;
}
.contents li{
padding: 2px 0 2px 0;
margin: 0;
ssbackground-color: pink;
}
.contents .textblock{
font-size: 10pt;
margin: 10px 50px 10px 50px;
line-height: 140%;
}
.contents .textblock code{
font-family: monospace;
font-size: 9pt;
}
.contents .todo{
font-size: 11pt;
margin: 10px 10% 20px 30px;
}
.contents .bug{
font-size: 11pt;
margin: 10px 10% 20px 30px;
}
dl
{
padding: 0 0 0 10px;
}
/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
dl.section
{
margin-left: 0px;
padding-left: 0px;
}
dl.note
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left: 4px solid;
border-color: #D0C000;
background-color: #FFFAC5;
border-radius: 10px;
}
ul dl.note{
margin-right: 0;
}
dl.warning, dl.attention
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left: 4px solid;
border-color: #FF909F;
background-color: #FFE1E5;
border-radius: 10px;
}
dl.pre, dl.post, dl.invariant
{
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #00D000;
}
dl.deprecated
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left:4px solid #B10BBF;
background-color: #FBC9FF;
border-radius: 10px;
}
dl.todo
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left:4px solid #00C0E0;
background-color: #DCFAFF ;
border-radius: 10px;
}
dl.bug
{
margin: 5px 10% 5px 30px;
padding: 10px;
border-left:4px solid red;
background-color: #FFC3B9 ;
border-radius: 10px;
}
dl.test
{
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #3030E0;
}
dl.bug
{
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #C08050;
}
dl.section dd {
margin-bottom: 6px;
}
table.directory tr {
border-bottom: 1px solid #cccccc !important;
}
table.directory tr:hover {
background-color: #F6FF88 !important;
}
table.directory td {
padding: 5px;
font-family: sans-serif;
}
/*****************************************************/
/* Quickref */
table.quickref {
font-size: 9pt;
font-family: monospace;
}
table.quickref tr:hover{
background-color: #F6FF88;
}
table.quickref td.qrow {
border-bottom: 1px solid #cccccc !important;
}
table td.h2 {
padding: 0;
margin: 0;
}
.qh2 {
background-color: #333333;
color: #eeeeee !important;
padding: 10px;
border-radius: 5px;
border: none;
margin: 0;
padding: 8px;
font-size: 15pt;
width: 100%;
}
table td.h3 {
background-color: #333333;
color: #eeeeee;
padding: 8px;
border-top-left-radius: 8px;
}
table td.h3top {
background-color: #333333;
padding: 8px;
border-top-right-radius: 8px;
text-align: right;
font-size: 8pt;
}
table td.h3top a{
color: #dddddd !important;
}
.h3topssssa {
color: #333333;
}
table td.tabletitle {
background-color: #cccccc;
font-size: 8pt;
}
td.tabletitlelink {
font-size: 8pt;
}
td.qoptiontitletd {
padding: 0;
margin: 0;
}
h4.qoptiontitle {
background-color: #bbbbbb;
font-size: 11pt;
font-weight: bold;
font-family: monospace;
padding: 5px 5px 5px 10px;
margin: 0;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.qlabel {
text-align: right;
font-size: 9pt;
width: 80px;
border-bottom: 1px solid #bbbbbb;
background-color: #dddddd;
font-family: sans-serif;
}
.qvalu {
font-size: 9pt;
font-weight: bold;
border-bottom: 1px solid #bbbbbb;
font-family: monospace;
border-left: 1px solid #bbbbbb;
}
.qdescription {
font-size: 11pt;
color: #333333;
margin: 0;
padding: 5px;
line-height: 140%;
border-left: 1px solid #bbbbbb;
border-bottom: 1px solid #bbbbbb;
}

View File

@ -1,448 +0,0 @@
<?xml version="1.0"?>
<!--
For generating the `tidy.1` man page from the
output of `tidy -xml-help` and `tidy -xml-config`
(c) 2005-2007 (W3C) MIT, ERCIM, Keio University
See tidy.h for the copyright notice.
Written by Jelks Cabaniss and Arnaud Desitter
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="description" />
<xsl:output method="text" />
<!--
The default template match is to the document passed on the
command line to the XSLT processor, currently "tidy-help.xml".
For the detailed config options section however, the template
match is to the file "tidy-config.xml". This is captured in
the $CONFIG variable, declared here:
-->
<xsl:variable name="CONFIG" select="document('tidy-config.xml')"/>
<!-- Main Template: -->
<xsl:template match="/">
<xsl:call-template name="header-section" />
<xsl:call-template name="cmdline-section" />
<xsl:call-template name="config-section" />
<xsl:call-template name="manpage-see-also-section" />
</xsl:template>
<!-- Named Templates: -->
<xsl:template name="header-section">
<xsl:text/>.\" tidy man page for the HTML Tidy
.TH TIDY 1 "<xsl:value-of select="cmdline/@version" />" "HTML Tidy" "<xsl:value-of select="cmdline/@version" />"
</xsl:template>
<xsl:template name="cmdline-section">
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
\fBtidy\fR - check, correct, and pretty-print HTML(5) files
.SH SYNOPSIS
\fBtidy\fR [option ...] [file ...] [option ...] [file ...]
.SH DESCRIPTION
Tidy reads HTML, XHTML, and XML files and writes cleaned-up markup. For HTML variants, it detects, reports, and corrects many common coding errors and strives to produce visually equivalent markup that is both conformant to the HTML specifications and that works in most browsers.
.LP
A common use of Tidy is to convert plain HTML to XHTML. For generic XML files, Tidy is limited to correcting basic well-formedness errors and pretty printing.
.LP
If no input file is specified, Tidy reads the standard input. If no output file is specified, Tidy writes the tidied markup to the standard output. If no error file is specified, Tidy writes messages to the standard error.
For command line options that expect a numerical argument, a default is assumed if no meaningful value can be found.
.SH OPTIONS
<xsl:call-template name="show-cmdline-options" />
.SH USAGE
.LP
Use \fB--\fR\fIoptionX valueX\fR for the detailed configuration option "optionX" with argument "valueX". See also below under \fBDetailed Configuration Options\fR as to how to conveniently group all such options in a single config file.
.LP
Input/Output default to stdin/stdout respectively. Single letter options apart from \fB-f\fR and \fB-o\fR may be combined as in:
.LP
.in 1i
\fBtidy -f errs.txt -imu foo.html\fR
.SH ENVIRONMENT
.TP
.B HTML_TIDY
Name of the default configuration file. This should be an absolute path, since you will probably invoke \fBtidy\fR from different directories. The value of HTML_TIDY will be parsed after the compiled-in default (defined with -DTIDY_CONFIG_FILE), but before any of the files specified using \fB-config\fR.
.SH "EXIT STATUS"
.IP 0
All input files were processed successfully.
.IP 1
There were warnings.
.IP 2
There were errors.
</xsl:template>
<xsl:template name="config-section">
.SH ______________________________
.SH " "
.SH "DETAILED CONFIGURATION OPTIONS"
This section describes the Detailed (i.e., "expanded") Options, which may be specified by preceding each option with \fB--\fR at the command line, followed by its desired value, OR by placing the options and values in a configuration file, and telling tidy to read that file with the \fB-config\fR standard option.
.SH SYNOPSIS
\fBtidy --\fR\fIoption1 \fRvalue1 \fB--\fIoption2 \fRvalue2 [standard options ...]
.br
\fBtidy -config \fIconfig-file \fR[standard options ...]
.SH WARNING
The options detailed here do not include the "standard" command-line options (i.e., those preceded by a single '\fB-\fR') described above in the first section of this man page.
.SH DESCRIPTION
A list of options for configuring the behavior of Tidy, which can be passed either on the command line, or specified in a configuration file.
.LP
A Tidy configuration file is simply a text file, where each option
is listed on a separate line in the form
.LP
.in 1i
\fBoption1\fR: \fIvalue1\fR
.br
\fBoption2\fR: \fIvalue2\fR
.br
etc.
.LP
The permissible values for a given option depend on the option's \fBType\fR. There are five types: \fIBoolean\fR, \fIAutoBool\fR, \fIDocType\fR, \fIEnum\fR, and \fIString\fR. Boolean types allow any of \fIyes/no, y/n, true/false, t/f, 1/0\fR. AutoBools allow \fIauto\fR in addition to the values allowed by Booleans. Integer types take non-negative integers. String types generally have no defaults, and you should provide them in non-quoted form (unless you wish the output to contain the literal quotes).
.LP
Enum, Encoding, and DocType "types" have a fixed repertoire of items; consult the \fIExample\fR[s] provided below for the option[s] in question.
.LP
You only need to provide options and values for those whose defaults you wish to override, although you may wish to include some already-defaulted options and values for the sake of documentation and explicitness.
.LP
Here is a sample config file, with at least one example of each of the five Types:
.LP
\fI
// sample Tidy configuration options
output-xhtml: yes
add-xml-decl: no
doctype: strict
char-encoding: ascii
indent: auto
wrap: 76
repeated-attributes: keep-last
error-file: errs.txt
\fR
.LP
Below is a summary and brief description of each of the options. They are listed alphabetically within each category. There are five categories: \fIHTML, XHTML, XML\fR options, \fIDiagnostics\fR options, \fIPretty Print\fR options, \fICharacter Encoding\fR options, and \fIMiscellaneous\fR options.
.LP
.SH OPTIONS
<xsl:call-template name="show-config-options" />
</xsl:template>
<xsl:template name="show-cmdline-options">
.SS File manipulation
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">file-manip</xsl:with-param>
</xsl:call-template>
.SS Processing directives
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">process-directives</xsl:with-param>
</xsl:call-template>
.SS Character encodings
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">char-encoding</xsl:with-param>
</xsl:call-template>
.SS Miscellaneous
<xsl:call-template name="cmdline-detail">
<xsl:with-param name="category">misc</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="cmdline-detail">
<!--
For each option in one of the 3 categories/classes, provide its
1. names
2. description
3. equivalent configuration option
-->
<xsl:param name="category" />
<xsl:for-each select='/cmdline/option[@class=$category]'>
<xsl:text>
.TP
</xsl:text>
<xsl:call-template name="process-names" />
<xsl:text>
</xsl:text>
<xsl:apply-templates select="description" />
<xsl:text>
</xsl:text>
<xsl:call-template name="process-eqconfig" />
</xsl:for-each>
</xsl:template>
<xsl:template name="process-names">
<!-- Used only in the cmdline section -->
<xsl:for-each select="name">
<xsl:text />\fB<xsl:value-of select="." />\fR<xsl:text />
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="process-eqconfig">
<!-- Used only in the cmdline section -->
<xsl:if test="string-length(eqconfig) &gt; 0">
<xsl:for-each select="eqconfig">
<xsl:text>(\fI</xsl:text>
<xsl:value-of select="." />
<xsl:text>\fR)</xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:template>
<xsl:template name="show-config-options">
<!-- Used only in the cmdline section -->
.SS HTML, XHTML, XML options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">markup</xsl:with-param>
</xsl:call-template>
.SS Diagnostics options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">diagnostics</xsl:with-param>
</xsl:call-template>
.SS Pretty Print options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">print</xsl:with-param>
</xsl:call-template>
.SS Character Encoding options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">encoding</xsl:with-param>
</xsl:call-template>
.SS Miscellaneous options:
<xsl:call-template name="config-detail">
<xsl:with-param name="category">misc</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!--
Note that any templates called implicitly or explicitly
from the "config-detail" template below will match on
the document referred to by the $CONFIG variable, i.e.,
the file "tidy-config.xml", created by running
tidy -xml-config > tidy-config.xml
The $CONFIG variable is set at the top level of this
stylesheet.
-->
<xsl:template name="config-detail">
<!--
For each option in one of the 5 categories/classes, provide its
1. name
2. type
3. default (if any)
4. example (if any)
5. seealso (if any)
6. description
-->
<xsl:param name="category" />
<xsl:for-each select='$CONFIG/config/option[@class=$category]'>
<xsl:sort select="name" order="ascending" />
.TP
\fB<xsl:apply-templates select="name" />\fR
Type: \fI<xsl:apply-templates select="type" />\fR
.br
<xsl:call-template name="provide-default" />
.br
<xsl:call-template name="provide-example" />
<xsl:text>
</xsl:text>
<xsl:apply-templates select="description" />
<xsl:call-template name="seealso" />
</xsl:for-each>
</xsl:template>
<!-- Used only in the config options section: -->
<xsl:template name="seealso">
<xsl:if test="seealso">
<xsl:text>
</xsl:text>
.rj 1
\fBSee also\fR: <xsl:text />
<xsl:for-each select="seealso">
<xsl:text />\fI<xsl:value-of select="." />\fR<xsl:text />
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!-- Used only in the config options section: -->
<xsl:template name="provide-default">
<!--
Picks up the default from the XML. If the `default` element
doesn't exist, or it's empty, a single '-' is provided.
-->
<xsl:choose>
<xsl:when test="string-length(default) &gt; 0 ">
<xsl:text />Default: \fI<xsl:apply-templates
select="default" />\fR<xsl:text />
</xsl:when>
<xsl:otherwise>
<xsl:text />Default: \fI-\fR<xsl:text />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Used only in the config options section: -->
<xsl:template name="provide-example">
<!--
By default, doesn't output examples for String types (mirroring the
quickref page). But for *any* options in the XML instance that
have an `example` child, that example will be used in lieu of a
stylesheet-provided one. (Useful e.g. for `repeated-attributes`).
-->
<xsl:choose>
<xsl:when test="string-length(example) &gt; 0">
<xsl:text />Example: \fI<xsl:apply-templates
select="example" />\fR<xsl:text />
</xsl:when>
<xsl:otherwise>
<xsl:text />Default: \fI-\fR<xsl:text />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Called from the templates below matching `code`, `em`, `strong`: -->
<xsl:template name="escape-backslash">
<!--
Since backslashes are "special" to the *roff processors used
to generate man pages, we need to escape backslash characters
appearing in content with another backslash.
-->
<xsl:choose>
<xsl:when test="contains(.,'\')">
<xsl:value-of select=
"concat( substring-before(.,'\'), '\\', substring-after(.,'\') )" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Appears at the bottom of the man page: -->
<xsl:template name="manpage-see-also-section">
.SH SEE ALSO
For more information about HTML Tidy:
.RS 4
.LP
http://www.html-tidy.org/
.RE
.LP
For more information on HTML:
.RS 4
.LP
\fBHTML: Edition for Web Authors\fR (the latest HTML specification)
.br
http://dev.w3.org/html5/spec-author-view
.LP
\fBHTML: The Markup Language\fR (an HTML language reference)
.br
http://dev.w3.org/html5/markup/
.RE
.LP
For bug reports and comments:
.RS 4
.LP
https://github.com/htacg/tidy-html5/issues/
.RE
.LP
Or send questions and comments to \fBpublic-htacg@w3.org\fR.
.LP
Validate your HTML documents using the \fBW3C Nu Markup Validator\fR:
.RS 4
.LP
http://validator.w3.org/nu/
.RE
.SH AUTHOR
\fBTidy\fR was written by \fBDave Raggett\fR &lt;dsr@w3.org&gt;, and subsequently maintained by a team at http://tidy.sourceforge.net/,
and now maintained by \fBHTACG\fR (http://www.htacg.org).
.LP
The sources for \fBHTML Tidy\fR are available at https://github.com/htacg/tidy-html5/ under the MIT Licence.
</xsl:template>
<!-- Regular Templates: -->
<xsl:template match="description">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="a">
<xsl:apply-templates />
<xsl:text /> at \fI<xsl:value-of select="@href" />\fR<xsl:text />
</xsl:template>
<xsl:template match="code | em">
<xsl:text />\fI<xsl:call-template name="escape-backslash" />\fR<xsl:text />
</xsl:template>
<xsl:template match="br">
<xsl:text>
.br
</xsl:text>
</xsl:template>
<xsl:template match="strong">
<xsl:text />\fB<xsl:call-template name="escape-backslash" />\fR<xsl:text />
</xsl:template>
<!--
The following templates
a) normalize whitespace, primarily necessary for `description`
b) do so without stripping possible whitespace surrounding `code`
d) strip leading and trailing whitespace in 'description` and `code`
(courtesy of Ken Holman on the XSL-list):
-->
<xsl:template match="text()[preceding-sibling::node() and
following-sibling::node()]">
<xsl:variable name="ns" select="normalize-space(concat('x',.,'x'))"/>
<xsl:value-of select="substring( $ns, 2, string-length($ns) - 2 )" />
</xsl:template>
<xsl:template match="text()[preceding-sibling::node() and
not( following-sibling::node() )]">
<xsl:variable name="ns" select="normalize-space(concat('x',.))"/>
<xsl:value-of select="substring( $ns, 2, string-length($ns) - 1 )" />
</xsl:template>
<xsl:template match="text()[not( preceding-sibling::node() ) and
following-sibling::node()]">
<xsl:variable name="ns" select="normalize-space(concat(.,'x'))"/>
<xsl:value-of select="substring( $ns, 1, string-length($ns) - 1 )" />
</xsl:template>
<xsl:template match="text()[not( preceding-sibling::node() ) and
not( following-sibling::node() )]">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -18,21 +18,21 @@ Node *nextTidyNode( TidyNodeIter *pThis )
{
if (NULL == pThis->pCurrent)
{
// just starting out, initialize
/* just starting out, initialize */
pThis->pCurrent = pThis->pTop->content;
}
else if (NULL != pThis->pCurrent->content)
{
// the next element, if any, is my first-born child
/* the next element, if any, is my first-born child */
pThis->pCurrent = pThis->pCurrent->content;
}
else
{
// no children, I guess my next younger brother inherits the throne.
/* no children, I guess my next younger brother inherits the throne. */
while ( NULL == pThis->pCurrent->next
&& pThis->pTop != pThis->pCurrent->parent )
{
// no siblings, do any of my ancestors have younger sibs?
/* no siblings, do any of my ancestors have younger sibs? */
pThis->pCurrent = pThis->pCurrent->parent;
}
pThis->pCurrent = pThis->pCurrent->next;

View File

@ -76,7 +76,7 @@ int parseURL( HTTPInputSource *pHttp, tmbstr url )
if (!pHttp->nPort)
return -1;
}
else /* or just a misformed port number */
else /* or just a malformed port number */
return -1;
}
else

View File

@ -19,7 +19,7 @@
TIDY_STRUCT
typedef struct _HTTPInputSource
{
TidyInputSource tis; // This declaration must be first and must not be changed!
TidyInputSource tis; /* This declaration must be first and must not be changed! */
tmbstr pHostName;
tmbstr pResource;

17
include/buffio.h Normal file
View File

@ -0,0 +1,17 @@
/** @file buffio.h - Deprecated compatibility header. Use tidybuffio.h
**
** @deprecated This compatibility header is deprecated and
** should be replaced by tidybuffio.h. This header will be removed!
**
*/
#ifdef __GNUC__
#warning "FIXME: Using compatibility tidy header (buffio.h) that will go away! Use tidybuffio.h"
#endif
#ifdef _MSC_VER
#pragma message("WARNING: ** FIXME ** Using compatibility tidy header (buffio.h) that will go away! Use tidybuffio.h")
#endif
#include "tidybuffio.h"

7
include/module.modulemap Normal file
View File

@ -0,0 +1,7 @@
module CLibTidy {
header "tidy.h"
header "tidybuffio.h"
header "tidyenum.h"
header "tidyplatform.h"
export *
}

15
include/platform.h Normal file
View File

@ -0,0 +1,15 @@
/** @file platform.h - Deprecated compatibility header. Use tidyplatform.h
**
** @deprecated This compatibility header is deprecated and
** should be replaced by tidyplatform.h. This header will be removed!
**
*/
#ifdef __GNUC__
#warning "FIXME: Using compatibility tidy header (platform.h) that will go away!"
#endif
#ifdef _MSC_VER
#pragma message("WARNING: ** FIXME ** Using compatibility tidy header (platform.h) that will go away! Use tidyplatform.h")
#endif
#include "tidyplatform.h"

Some files were not shown because too many files have changed in this diff Show More