On Fri, 18 Dec 2020 02:34:16 GMT, Yoshiki Sato <ysato...@openjdk.org> wrote:

>> HTML4 is no longer supported in javadoc.
>> 
>> doclint needs to drop HTML4 support as well.
>> The changes consist of:
>> * Removing jdk.javadoc.internal.doclint.HtmlVersion and its references.
>> * Sorting out supported tags and attributes in HTML5 (including fix 
>> incorrect permission of valign in TH, TR, TD, THEAD and TBODY)
>> * Modifying test code and expected outputs to be checked in HTML5
>
> Yoshiki Sato has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   5th: 8258460: Remove --doclint-format option from javac

One must-fix item (bad pattern constant.)

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java line 
736:

> 734: 
> 735:     // https://html.spec.whatwg.org/#the-id-attribute
> 736:     private static final Pattern validId = Pattern.compile("[^\s]+");

The regular expression is invalid and needs to be fixed. It should be 
`Pattern.compile("[^\\s]+")`
Note the extra `` character. This is because you need to escape the `` 
character in the string constant, so that the `` is seen in the pattern as part 
of `\s`.

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java line 
710:

> 708: 
> 709: 
> 710:     private boolean checkAnchor(String name) {

I was going to let it slide for this round of cleanup, but if you're editing 
this file again (see comment on line 736) it might be worth changing the use of 
`anchor` to `id`.  `anchor` is a term that was more appropriate in the days 
before the `id` attribute, when we used `<a name="...">`.  This is an optional 
suggestion.  It might equally be worth focussing on the must-fix items, and 
postpone this cleanup for later.

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

Changes requested by jjg (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/893

Reply via email to