aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-10-31 12:16:38 +0100
committerGitHub <noreply@github.com>2023-10-31 12:16:38 +0100
commit7951aff0650b4c50b82a987ba4f23879f18c9436 (patch)
tree9b75e0089f8d391f50e1bb0f6849475b12b9874d /plugins
parentedcd1fb24d01e11b5a8185328255f2005aadf037 (diff)
downloaddokka-7951aff0650b4c50b82a987ba4f23879f18c9436.tar.gz
dokka-7951aff0650b4c50b82a987ba4f23879f18c9436.tar.bz2
dokka-7951aff0650b4c50b82a987ba4f23879f18c9436.zip
Update org.jetbrains.markdown from 0.3.1 to 0.5.2 (#3231)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/src/test/kotlin/markdown/ParserTest.kt55
1 files changed, 54 insertions, 1 deletions
diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
index 8e2d71eb..bcca27c4 100644
--- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
@@ -1573,7 +1573,60 @@ class ParserTest : KDocTest() {
P(listOf(Text(" sdsdsds sdd"))),
P(listOf(Text(" eweww ")))
)
- print(expectedDocumentationNode)
+ assertEquals(actualDocumentationNode, expectedDocumentationNode)
+ }
+
+ @Test // exists due to #3231
+ fun `should ignore the leading whitespace in header in-between the hash symbol and header text`() {
+ val markdown = """
+ | # first header
+ | ## second header
+ | ### third header
+ """.trimMargin()
+ val actualDocumentationNode = parseMarkdownToDocNode(markdown).children
+ val expectedDocumentationNode = listOf(
+ H1(listOf(Text("first header"))),
+ H2(listOf(Text("second header"))),
+ H3(listOf(Text("third header"))),
+ )
+ assertEquals(actualDocumentationNode, expectedDocumentationNode)
+ }
+
+ @Test // exists due to #3231
+ fun `should ignore trailing whitespace in header`() {
+ val markdown = """
+ | # first header
+ | ## second header
+ | ### third header
+ """.trimMargin()
+ val actualDocumentationNode = parseMarkdownToDocNode(markdown).children
+ val expectedDocumentationNode = listOf(
+ H1(listOf(Text("first header"))),
+ H2(listOf(Text("second header"))),
+ H3(listOf(Text("third header"))),
+ )
+ assertEquals(actualDocumentationNode, expectedDocumentationNode)
+ }
+
+ @Test // exists due to #3231
+ fun `should ignore leading and trailing whitespace in header, but not whitespace in the middle`() {
+ val markdown = """
+ | # first header
+ | ## second ~~header~~ in a **long** sentence ending with whitespaces
+ | ### third header
+ """.trimMargin()
+ val actualDocumentationNode = parseMarkdownToDocNode(markdown).children
+ val expectedDocumentationNode = listOf(
+ H1(listOf(Text("first header"))),
+ H2(listOf(
+ Text("second "),
+ Strikethrough(listOf(Text("header"))),
+ Text(" in a "),
+ B(listOf(Text("long"))),
+ Text(" sentence ending with whitespaces")
+ )),
+ H3(listOf(Text("third header"))),
+ )
assertEquals(actualDocumentationNode, expectedDocumentationNode)
}
}