aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/markdown/ParserTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/markdown/ParserTest.kt')
-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)
+ }
}