aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-04-14 15:15:48 +0200
committerGitHub <noreply@github.com>2021-04-14 15:15:48 +0200
commitd0f83037a12441145d35090461ef3c91df4c4076 (patch)
treeace7e41d4048a848179409b648cf88a32659cae4 /plugins/base/src/test
parentf27be3dfd3fa264f946161611638ad260a0ff392 (diff)
downloaddokka-d0f83037a12441145d35090461ef3c91df4c4076.tar.gz
dokka-d0f83037a12441145d35090461ef3c91df4c4076.tar.bz2
dokka-d0f83037a12441145d35090461ef3c91df4c4076.zip
Handle html in kdoc (#1805)
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/markdown/ParserTest.kt36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
index 4ac4a43f..a9e1eee4 100644
--- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
@@ -1481,5 +1481,41 @@ class ParserTest : KDocTest() {
exception?.message
)
}
+
+ @Test
+ fun `should ignore html comments`() {
+ val kdoc = """
+ | # Example <!--- not visible in header --> Kdoc
+ | <!-- not visible alone -->
+ | Pre <!--- not visible --> visible
+ """.trimMargin()
+ val expectedDocumentationNode = DocumentationNode(
+ listOf(
+ Description(
+ CustomDocTag(
+ listOf(
+ H1(
+ listOf(
+ Text("Example "),
+ Text("<!--- not visible in header -->", params = mapOf("content-type" to "html")),
+ Text(" Kdoc")
+ )
+ ),
+ Text("<!-- not visible alone -->", params = mapOf("content-type" to "html")),
+ P(
+ listOf(
+ Text("Pre "),
+ Text("<!--- not visible -->", params = mapOf("content-type" to "html")),
+ Text(" visible")
+ )
+ )
+ ),
+ name = MarkdownElementTypes.MARKDOWN_FILE.name
+ )
+ )
+ )
+ )
+ executeTest(kdoc, expectedDocumentationNode)
+ }
}