From d0f83037a12441145d35090461ef3c91df4c4076 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 14 Apr 2021 15:15:48 +0200 Subject: Handle html in kdoc (#1805) --- .../base/src/test/kotlin/markdown/ParserTest.kt | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'plugins/base/src/test/kotlin') 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 Kdoc + | + | Pre visible + """.trimMargin() + val expectedDocumentationNode = DocumentationNode( + listOf( + Description( + CustomDocTag( + listOf( + H1( + listOf( + Text("Example "), + Text("", params = mapOf("content-type" to "html")), + Text(" Kdoc") + ) + ), + Text("", params = mapOf("content-type" to "html")), + P( + listOf( + Text("Pre "), + Text("", params = mapOf("content-type" to "html")), + Text(" visible") + ) + ) + ), + name = MarkdownElementTypes.MARKDOWN_FILE.name + ) + ) + ) + ) + executeTest(kdoc, expectedDocumentationNode) + } } -- cgit