Commit graph

183 commits

Author SHA1 Message Date
Geoff McLane 66e288a8e2 Issue #239 - no warn for apos enitity in html5++ mode 2015-08-22 14:03:02 +02:00
Geoff McLane e79137de7f Issue #238 - only except the pre element 2015-08-22 14:00:18 +02: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
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 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 38ef5bfe85 Issue #232 remove CM_HEAD from 'object' tag 2015-07-30 14:50:15 +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
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
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
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
Geoff McLane 1e70fc6f15 Rename two headers. Issues #224 #223 #221
But this seemed a good time to release 5.0.0.RC1...
2015-06-30 20:06:02 +02: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 3aa50740da Issue #215 - only issue warning if NOT HTML5 mode 2015-06-21 19:49:44 +02:00
Geoff McLane e71bda718f Add TIDY_CALL to tidyLibraryVersion func. 2015-06-09 20:04:49 +02:00
Geoff McLane 18880eab55 Issue #218 - Do NOT allocate a 1 byte null String buffer.
This is when setting a String config value through say tidyOptSetValue
using say tidyOptSetValue(tdoc,id,"").

If the length of the new string is zero then do not allocate a 1 byte
buffer, set it to 0, for the option. Any previous buffer has already been
released.

This means API functions like tidyOptSaveSink will not return erroneous
null String values!
2015-06-08 13:52:00 +02:00
Geoff McLane 3f72b6e335 Issue #210 - Add new warning for summary attr in table if HTML5.
This new warning will only be seen if the document remains in HTML5 mode,
where the summary attribute is obsolete. The W3C validator flags this as
an error, and suggests 'Consider describing the structure of the table in
a caption element or in a figure element containing the table; or simplify
the structure of the table so that no description is needed'.

At the same time this patch also restored the old warning if the document
is HTML4--, if the table element lacks a summary attribute. This has been
a tidy warning since the beginning of time, although the W3C validator
does not presently flag this.
2015-06-06 11:20:35 +02:00
Geoff McLane 326f2414fd Issue #212 - Further fix to set MixedContent in some cases.
In certain circumstances a leading space has to be preverved to allow it
to be used to create a text space node to insert before this element to
preserve the view in a browser.

And added a note asking why is ParseTag called with a hardcoded
IgnoreWhitespace when some effort above has set the mode variable to
MixedContent in certain cases, but need to think about this 2nd change.

Also added some MSVC Debug output when this leading text is used to insert
such a created text node before the element just to be reminded of this
special event.
2015-06-04 13:12:05 +02:00
Geoff McLane a278b04a19 Add debug display of text modes.
Note this ONLY effects a MSVC Debug build!
2015-06-04 12:59:02 +02:00
Geoff McLane c18f27a587 Issue #217 - avoid len going negative, ever... 2015-06-03 20:26:03 +02:00
Geoff McLane 0fb7ccdfc6 Add some mem alloc and free debug to chase Issue #217
Such debug is OFF by default, and only added by defining DEBUG_MEMORY. And
is only available for the Debug configuration compiled with MSVC, but this
could be easily extended...
2015-06-03 20:24:41 +02:00
Geoff McLane 944b412fe6 Need extra include if UNICODE is defines 2015-06-02 20:44:00 +02:00
Geoff McLane b8bc88522c small fix for indent-with-tabs to have a default xml value 2015-05-25 16:48:39 +02:00
Denis Denisov 5a28d5f010 5.0.0
htacg/tidy-html5#190
2015-05-24 23:49:00 +03:00
Geoff McLane d923dd7b2d Issue #108 - first cut new option --indent-with-tabs yes. 2015-05-22 16:06:12 +02:00
Geoff McLane 5d5e689f1a For issue #212, retain mixed mode block parsing.
This is particularly for the anchor tag which in html5 mode is parsed in
ParseBlock. That is retain a leading space, in case it needs to be
moved to in front of the block to keep space rendering.
2015-05-13 12:35:06 +02:00
Geoff McLane 963caf0741 add counter for in ParseBlock 2015-05-12 17:14:09 +02:00
Geoff McLane c1a3100cb9 add conveninet break point based on row and column 2015-05-12 17:13:23 +02:00
Geoff McLane b2b9f1d6f2 spelling error noted in exploration of #207 in localize.c 2015-04-26 19:19:55 +02:00
Dmitry Ivanov 9a3f85d44c Support build with MinGW 4.9.1 2015-04-26 13:18:46 +03:00
Geoff McLane 2f6b3d49b6 Merge pull request #202 from aerilon/master
Please pull fix for #198 and #199
2015-04-22 21:24:12 +02:00
Geoff McLane f5eb2cf26a Issue #196 - expand comment and bump version.
Thanks to @willydee for this PR.
2015-04-11 15:25:07 +02:00
willydee 253a7e54c3 Fix for #196: HTML5 allows block elements in <CAPTION> 2015-04-11 15:06:35 +02:00
Arnaud Lacombe c05661df11 Issue #199 - Add support for html5's template tag 2015-04-10 15:50:07 -07:00
Geoff McLane e78c0105d3 Indicated by #191, why show doctype warning if omitted in output 2015-04-08 18:45:31 +02:00
Geoff McLane 5cbd3ee95b From issue #191, saw need to revert to 'master' branch 2015-04-08 17:55:12 +02:00
Geoff McLane 3585d4c31a Issue #186 - Move FreeLexer() to near last 2015-03-19 19:14:27 +01:00
Geoff McLane 79ac8b2554 Issue #185 - Treat elements ids as case-sensitive if in HTML5 mode 2015-03-13 19:47:28 +01:00
Geoff McLane 66a597f5b7 related to issue #180 - remove additional line unless 'classic' 2015-03-10 12:27:29 +01:00
Geoff McLane 9caab688f1 debug - avoid duplicae output if to stdout 2015-03-09 16:12:59 +01:00
Geoff McLane fd7b4f8589 just some more DEBUG on text nodes 2015-03-06 19:28:52 +01:00
Geoff McLane c0cad3aeba Issue #167 - further fixes for HTML5 mode 2015-03-06 19:13:06 +01:00
Geoff McLane 389ce17814 add attr to dbg_show_node 2015-03-06 18:36:01 +01:00
Geoff McLane 0dc68d6cb1 Issue #167 & #169 - default to HTML5 mode.
Revert TidyTag_A to HTML5 mode, but allow the table to be modified if the
DOCTYPE given is found to NOT be HTML5, through a service TY_(AdjustTags).
Care is taken to clear any previous hash cached tags.

At present this only effects the anchor tag, but could be applied to
others that need to change their parsing due to an identified DOCTYPE.
2015-03-06 12:55:24 +01:00