Commit Graph

73 Commits

Author SHA1 Message Date
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 d956d6ca1c Refactored debug output. 2021-08-23 11:02:27 -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 0d72ca395f Fixes #611. 2021-08-17 14:51:40 -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 6001011c80 Fixes #464. Test cases added. 2021-08-17 11:38:42 -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 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 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 e56716f154 Improve internal documentation.
Start general conversion to eliminate and/or reduce recursion.
2021-07-28 19:46:54 -04:00
Jim Derry 1bb72d6041 Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -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
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 3b154dc407 Issue #604 - Try to fix. Initial cut. WIP 2017-10-13 20:50:53 +02: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 ee54057d76 Added debug to several files. WIP 2017-10-03 21:09:59 -04:00
Jim Derry 4e3c1a1562 Move all of the sprtf includes into tidyplatform.h 2017-10-03 20:42:29 -04:00
Jim Derry 8d7e5f7f5a Documentation formatting. 2017-10-03 15:30:21 -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 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 a1e4dcc066 Removed option for SUPPORT_ACCESSIBILITY_CHECKS, regen'd strings. 2017-10-03 12:45:34 -04:00
Jim Derry 47a32891c8 Merge branch 'issue_521' into next 2017-10-02 13:27:16 -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 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
Geoff McLane 55d287bc9d Issue #597 - Free the 'node' not stacked, and add 'message' 2017-09-18 19:47:52 +02: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 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
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
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
Geoff McLane 5f88452487 Issue #333 - create exception for span/meta 2017-03-26 16:57:29 +02: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
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 fd0ccb2bbf Bad, repeated node iteration! closes #459 2016-10-30 23:37:31 +01:00
Geoff McLane 685f7a6c5b Issue #428 - Avoid adding form to input if html5 2016-07-02 20:13:01 +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 7777a71913 Issue #369 - Remove Debug asserts 2016-03-31 14:50:03 +02:00
Geoff McLane 8eee85cb9e Issue #380 - Experimental patch in issue-380 branch 2016-03-05 17:39:14 +01:00
Geoff McLane 0e6ed639d6 Issue #380 - Add more MSVC debug 2016-03-04 19:28:49 +01:00
Geoff McLane 24c62cf0df Issue #314 - Avoid head warning if show-body-only 2016-02-29 18:49:15 +01:00
Geoff McLane 7f0d5c31e6 If no doctype, allow user doctype to reset table - Issue #342 2016-02-01 19:44:30 +01: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
Geoff McLane 78f2d52cdd Issue #308 - remove bad warn, bad assert, and free discarded 2015-12-05 15:03:41 +01:00