diff options
author | nerix <nero.9@hotmail.de> | 2025-02-05 14:46:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-05 08:46:14 -0500 |
commit | 7d669b7c25e15034a85cc4888465084e7f05f251 (patch) | |
tree | 031a5c9bd449d2adcdebd65dc981b85dc95a81a9 /clang/unittests/AST/CommentParser.cpp | |
parent | bcfd9f81e1bc9954d616ffbb8625099916bebd5b (diff) | |
download | llvm-7d669b7c25e15034a85cc4888465084e7f05f251.zip llvm-7d669b7c25e15034a85cc4888465084e7f05f251.tar.gz llvm-7d669b7c25e15034a85cc4888465084e7f05f251.tar.bz2 |
[Clang][Comments] Allow HTML tags across multiple lines (#120843)
HTML starting tags that span multiple lines were previously not allowed
(or rather, only the starting line was lexed as HTML). Doxygen allows
those tags.
This PR allows the starting tags to span multiple lines. They can't span
multiple (C-)Comments, though (it's likely a user-error). Multiple BCPL
comments are fine as those are single lines (shown below).
Example:
```c
/// <a
/// href="foo"
/// >Aaa</a>b
int Test;
```
Fixes #28321.
Diffstat (limited to 'clang/unittests/AST/CommentParser.cpp')
-rw-r--r-- | clang/unittests/AST/CommentParser.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/clang/unittests/AST/CommentParser.cpp b/clang/unittests/AST/CommentParser.cpp index e0df182..aa08b67 100644 --- a/clang/unittests/AST/CommentParser.cpp +++ b/clang/unittests/AST/CommentParser.cpp @@ -1065,9 +1065,10 @@ TEST_F(CommentParserTest, InlineCommand5) { TEST_F(CommentParserTest, HTML1) { const char *Sources[] = { - "// <a", - "// <a>", - "// <a >" + "// <a", + "// <a>", + "// <a >", + "// <a\n// >", }; for (size_t i = 0, e = std::size(Sources); i != e; i++) { @@ -1088,8 +1089,9 @@ TEST_F(CommentParserTest, HTML1) { TEST_F(CommentParserTest, HTML2) { const char *Sources[] = { - "// <br/>", - "// <br />" + "// <br/>", + "// <br />", + "// <br \n// />", }; for (size_t i = 0, e = std::size(Sources); i != e; i++) { @@ -1110,10 +1112,8 @@ TEST_F(CommentParserTest, HTML2) { TEST_F(CommentParserTest, HTML3) { const char *Sources[] = { - "// <a href", - "// <a href ", - "// <a href>", - "// <a href >", + "// <a href", "// <a href ", "// <a href>", + "// <a href >", "// <a \n// href >", }; for (size_t i = 0, e = std::size(Sources); i != e; i++) { @@ -1134,8 +1134,9 @@ TEST_F(CommentParserTest, HTML3) { TEST_F(CommentParserTest, HTML4) { const char *Sources[] = { - "// <a href=\"bbb\"", - "// <a href=\"bbb\">", + "// <a href=\"bbb\"", + "// <a href=\"bbb\">", + "// <a \n// href=\"bbb\">", }; for (size_t i = 0, e = std::size(Sources); i != e; i++) { |