Commit Graph

66 Commits

Author SHA1 Message Date
Jim Derry 1bb72d6041 Spelling fixes, thanks to @jschleus. 2021-07-21 15:50:53 -04:00
Doug Richardson dfd74c4803
Add muted and playsinline video attributes for HTML5. 2021-05-11 20:53:03 -07:00
Russell Morris 7c2d950f13
Change open tag to Boolean (#932)
To address issue #925, PR #932
2021-04-15 18:21:00 +02: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 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
Caleb Callaway 20f1e3c7bc
Fix percentage validation in CheckLength (#912)
Fixes #910
2020-11-22 19:45:32 +01:00
Caleb Callaway 91ae1274ac
Add SVG paint attributes (#907)
Fixes #903
2020-11-22 18:02:00 +01:00
Sid Vishnoi e5ef43f6c3
Is. #879: add loading attribute for img, iframe (#902)
Closes #879
2020-11-21 18:03:20 +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 e46435fb29 Is #797 - use 'TidyRealloc' in place of raw 'realloc' 2019-01-31 20:01:02 +01: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
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 8723681275 PR #712 - Only allow 'auto' on 'dir' for HTML5
modified:   src/attrs.c
2018-04-23 19:02:03 +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
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 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
Jim Derry 5e66816380 Spacing consistency. 2017-10-08 10:25:09 -04:00
Jim Derry 5ff6aa8a8b Not sure how this got missed... 2017-10-03 14:46:29 -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 0e3cb7c78e Merge branch 'issue_598' into next 2017-10-02 13:34:59 -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 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 9b2cd06711 Merge branch 'next' into issue-365 2017-05-13 22:27:14 -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 982504eee0 Case insensitive compare is safe here, and prevents erroneous propriertary attribute errors. 2017-05-12 08:28:11 -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 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 66de84bc2b - Add support for the `is` attribute.
- Add support for autonomous custom elements.
2017-03-13 13:45:32 -04: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
Marcos Caceres e4ae9c064d Add support for link 'as' attribute (closes #449) 2016-08-23 18:46:04 +10: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
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
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 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 7d0d8a853a Issue #345 - discard leading spaces in href 2016-02-01 20:07:55 +01:00
Christopher Brannon 1ef5ba7968 Fix a tiny buffer overflow. 2015-11-23 12:28:00 -08: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
Geoff McLane c68ad42482 Revert 22a1922c35 2015-11-07 14:50:10 +01:00
Shane McCarron c572e3e3c8 Initial cut at supporting RDFa attributes. 2015-11-06 12:19:05 -06: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 6e3b293985 Issue #130 - Add TidyAttr_DISPLAY for math tag 2015-02-13 18:37:07 +01:00
Geoff McLane d72e681d32 Issue #152 - add srcset and sizes to img tag 2015-02-06 19:24:04 +01:00
Geoff McLane 698396eaa0 Issue #149 - avoid crash on null attr value 2015-02-03 13:38:20 +01:00
Geoff McLane 885c7caab7 Issue #70 - Initial implmentation of SVG support.
An immense thanks to Ger Hobbelt who had already done this
in his github.com/GerHobbelt/htmltidy fork.

The two sources have diverges so was not a simple cut
an paste. But again thanks Ger for this.
2015-02-02 17:36:27 +01:00
Geoff McLane f884da577d Small fix for TidyAttr_ASYNC to CH_BOOL 2015-01-20 18:10:13 +01:00