[Clang][Comments] Parse `<img src=""/>` in doc comments correctly
authorEgor Zhdan <e_zhdan@apple.com>
Tue, 30 Aug 2022 11:55:43 +0000 (12:55 +0100)
committerEgor Zhdan <e_zhdan@apple.com>
Thu, 1 Sep 2022 12:17:42 +0000 (13:17 +0100)
commit0cb08093365478224f2a58cece42527fb8e1199e
treeee8f8f07e4dba0f5174243194f30b67646b34a82
parent39e0a87c26e0d2b7498186a446dda4ec3d9b709d
[Clang][Comments] Parse `<img src=""/>` in doc comments correctly

This is a valid HTML5 tag. Previously it triggered a Clang error (`HTML start tag prematurely ended, expected attribute name or '>'`) since Clang was treating `/>` as a text token. This was happening because after lexing the closing quote (`"`) the lexer state was reset to "Normal" while the tag was not actually closed yet: `>` was not yet parsed at that point.

rdar://91464292

Differential Revision: https://reviews.llvm.org/D132932
clang/lib/AST/CommentLexer.cpp
clang/test/Index/comment-to-html-xml-conversion.cpp
clang/test/Sema/warn-documentation.cpp