RFR: 8322708: Global HTML attributes are not allowed [v3]

Jonathan Gibbons jjg at openjdk.org
Fri Jun 14 12:15:47 UTC 2024


On Tue, 11 Jun 2024 15:09:03 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> I think like being slightly restrictive and safe.
>
> As @jonathan-gibbons likes to point out, javadoc is not an HTML validation tool. So I think, it's okay to leave the code simple. Maybe this would be even simpler?
> 
>     data-[a-z][-a-z0-9]*

I admit to being "lazy" when I wrote `startsWith("on")`. In general, I don't think folk should be writing many if any event handlers in doc comments, and it was easier to give forward compatibility with a weak test for `"on"`. Likewise, there should not be many if any uses of `data-*` attributes, and it is easy enough to give a simple regex. It's more important to not reject valid uses of event attributes and custom data attributes than it is to detect all invalid cases. The right place to detect all invalid cases is downstream in recognized validation tools, like `tidy` which catch all occurrences of bad stuff, wherever they originate (doc comment, command-line options, the `javadoc` tool, post-processors, etc).  DocLint is primarily an "early warning system" for common errors.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19652#discussion_r1635600065


More information about the javadoc-dev mailing list