Commit graph

32 commits

Author SHA1 Message Date
Geoff McLane 22dcea067e Issue #335, maybe #333, to output indent char, reduce if tab 2017-03-26 16:57:29 +02: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 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 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 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
Jim Derry 873794162a Callback added to XML printer, too; fixed off-by-one error. 2015-11-29 07:39:33 +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
Geoff R. McLane b98061ff62 fix gcc warning parentheses in pprint.c 2015-11-18 16:47:58 +01:00
Geoff McLane c48680cc01 Issue #180 - fix indenting when -omit used 2015-09-10 15:01:48 +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
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 3a524f1710 Issue #207 - deal with 2 cases of an unambiguous ampersand.
html5 allows a naked ampersand unquoted, and now tidy will not issue a
warning. This only deals with a & b, and P&<li>O</li>

More may need to be done for other cases.
2015-06-24 13:10:27 +02:00
Geoff McLane d923dd7b2d Issue #108 - first cut new option --indent-with-tabs yes. 2015-05-22 16:06:12 +02:00
Geoff McLane 66a597f5b7 related to issue #180 - remove additional line unless 'classic' 2015-03-10 12:27:29 +01:00
Geoff McLane 4b2943edb3 Issue #162 - fix for this while hopefully maintaining #111 fix.
The fix for #111 added an end tag for all StartEnd tags, when outputting
HTML5, but there should be some exceptions to this.

Added a new service, isVoidElement(node) for the void elements. Perhaps
this service could be further optimised.
2015-02-24 17:51:59 +01:00
Geoff McLane 0aa81eb256 Issue #130 - MathML attr and entity fix!
This is a set of kludgy fixes for MathML attribute and entities support.

It is intended that a full HTML5 entity table be added at some time, but
at present ALL entities are accepted as written when within the math
element.

Likewise all attributes are accepted on MathML elements without any check
of their name or value, even if they match attributes outside MathML.

And in the pprinter such entities are written as is from the lexer, using
a new PPrintMathML service added, using the new mode OtherNameSpace.

It is hoped all these fixes will NOT effect tidy outside the math element.

ALL fixes in the set a clearly marked '#130 - MathML attr and entity fix!'
for easy searching, and improving if possible.
2015-02-22 18:58:55 +01:00
Geoff McLane cff3fdd308 Issue #133 - hopefully a better fix.
As predicted the previous fix had adverse consequences on say script text,
which then lost the indent, and was reverted.

This introduces a new service, nodeIsTextLike, which naturally returns yes
if it is text, but also is an AspTag.

Maybe other text like nodes need to be added.
2015-02-12 15:24:38 +01:00
Geoff McLane 5d2cbd10dc Revert "Issue #133 - ever increasing indent!"
This reverts commit 0f80c08355.

This commit had other BAD consequences
2015-02-12 14:56:51 +01:00
Geoff McLane ea50bd30e7 add comment only for potential fix of Issue #8 2015-02-10 15:32:05 +01:00
Geoff McLane 63c6671f59 Issue #126 - partial fix for indenting style 2015-02-01 18:35:28 +01:00
Geoff McLane 0f80c08355 Issue #133 - ever increasing indent!
This is a simple but profound change in pprint.c.
Since leading space is preserved on script code, after tidy indents
the code once, a second run on that tidied file would add more indent
to already indented code. This fix should be carefully checked,
and removed if there are other bad consequences.
Bump the version point to 4 for this change.
2015-02-01 14:34:22 +01:00
Geoff McLane 9fb90f55d4 Oops, that fix should be after a potential new line in head 2015-01-26 12:23:41 +01:00
Geoff McLane 813f1c8a13 Issue #56 - long outstanding bug on script tag
Added a PCondFlushLine before emitting the script tag
Certainly looks better, but need to check for any regression
2015-01-25 21:03:16 +01:00
Eberhard Beilharz 3d4c4021ae Print end tag for self-closing tag
When we output HTML5 and we encounter a self-closing tag we have to
output an end tag to be standard conform.

This fixes issue #111.
2014-01-09 17:38:41 +01:00
Craig Barnes ce27a729dc Remove CVS info blocks 2012-08-08 17:27:29 +01:00
Michael[tm] Smith c66f165f00 Don't line-wrap title attr. Thx Oliver Prygotzki.
Fixes #28.
2012-04-07 15:58:28 +09:00
Michael[tm] Smith 2cd21a6693 Added omit-optional-tags option. Fixes #22.
Thanks towolf.
2012-03-24 19:04:46 +09:00
Michael[tm] Smith b92d7aab88 new 2011-11-17 11:44:16 +09:00