[jdk19] RFR: 8281969: Bad result for the snippet @link tag if substring/regex consists of whitespace [v4]

Jonathan Gibbons jjg at openjdk.org
Thu Jul 14 21:26:14 UTC 2022


On Thu, 14 Jul 2022 21:05:56 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> This PR fixes how links inside a snippet treat whitespace.
>> 
>> During the development of the "Snippets" feature, the concern was about presentation of links that contain leading or trailing whitespace. For that reason, any such whitespace was trimmed. I think it's now reasonable to simplify code and say that any such presentation concerns should be solved with presentation tools, such as CSS.
>
> Pavel Rappo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   test: add regex case

While maybe not as bad as "garbage in: garbage out", the test case being fixed does have an aspect of "stupid in: stupid out". 

I'm torn between wanting consistency between the different forms of `link` (doc comment tags and snippet markup tags) and consistency between the examples given in the bug report for highlight and link markup tags.

On the other hand, if people want to do something stupid, like link a whitespace character, well, maybe we should let them, even though I think it's a dreadful idea to do so.   Although I must admit, if I'd been the one fixing this, I would have detected and rejected this case, given a warning, and ignored the tag.

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

PR: https://git.openjdk.org/jdk19/pull/142


More information about the javadoc-dev mailing list