RFR: JDK-8268335: Find better way to exclude empty HTML elements [v5]
Hannes Wallnöfer
hannesw at openjdk.java.net
Thu Apr 14 13:24:15 UTC 2022
On Mon, 14 Mar 2022 18:27:54 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>
> There is one question about why `HtmlTree.A` might reasonably be empty in HTML 5. The only reason I can think of is to declare an `id`, since an `href` with no content is unclickable. But a node with just an `id` and no content can apply to other nodes as well, can't it? e.g. `span`
You are right in that this is not correct in context of HTML 5. My purpose was to be liberal in what is accepted. Specifically `TestHtmlDocument.java` contains some HTML constructs which are not quite up to date and I wanted to continue accepting them as far as possible. But it's true that in this case it's mostly the `id` attribute which makes an empty element worth keeping, so I changed the criteria to look for that instead of the `A` tag.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7159
More information about the javadoc-dev
mailing list