diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-04-14 15:15:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 15:15:48 +0200 |
commit | d0f83037a12441145d35090461ef3c91df4c4076 (patch) | |
tree | ace7e41d4048a848179409b648cf88a32659cae4 /plugins/base/src/test | |
parent | f27be3dfd3fa264f946161611638ad260a0ff392 (diff) | |
download | dokka-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.kt | 36 |
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) + } } |