From 176b7354496a9135646ba9fc81976711d4de62c3 Mon Sep 17 00:00:00 2001 From: Andrea Falcone <1848683+asfalcone@users.noreply.github.com> Date: Tue, 8 Feb 2022 11:50:46 -0500 Subject: Add support for header tags in Javadoc (#2345) --- .../src/test/kotlin/parsers/JavadocParserTest.kt | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt') diff --git a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt index c066075a..4f37923b 100644 --- a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt +++ b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt @@ -349,4 +349,51 @@ class JavadocParserTest : BaseAbstractTest() { } } } + + @Test + fun `header tags are handled properly`() { + val source = """ + |/src/main/kotlin/test/Test.java + |package example + | + | /** + | * An example of using the header tags + | *

A header

+ | *

A second level header

+ | *

A third level header

+ | */ + | public class Test {} + """.trimIndent() + testInline( + source, + configuration, + ) { + documentablesCreationStage = { modules -> + val docs = modules.first().packages.first().classlikes.single().documentation.first().value + val root = docs.children.first().root + + kotlin.test.assertEquals( + listOf( + P(children = listOf(Text("An example of using the header tags "))), + H1( + listOf( + Text("A header") + ) + ), + H2( + listOf( + Text("A second level header") + ) + ), + H3( + listOf( + Text("A third level header") + ) + ) + ), + root.children + ) + } + } + } } -- cgit