diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2022-09-26 16:33:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 16:33:24 +0300 |
commit | a816e917995858129ad074409f73e99d3b100318 (patch) | |
tree | 746bbe15a2055642179c2aa9ab4e3580c9cf95bb /plugins/base/src/test/kotlin/model | |
parent | a0250a5d8188fd539ffe516f7c49ce0eed1d3ded (diff) | |
download | dokka-a816e917995858129ad074409f73e99d3b100318.tar.gz dokka-a816e917995858129ad074409f73e99d3b100318.tar.bz2 dokka-a816e917995858129ad074409f73e99d3b100318.zip |
Trim four spaces inside indented code block (#2661)
* Trim four spaces inside indented code block
* Fix test
Diffstat (limited to 'plugins/base/src/test/kotlin/model')
-rw-r--r-- | plugins/base/src/test/kotlin/model/CommentTest.kt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/model/CommentTest.kt b/plugins/base/src/test/kotlin/model/CommentTest.kt index 0742587a..c511a3de 100644 --- a/plugins/base/src/test/kotlin/model/CommentTest.kt +++ b/plugins/base/src/test/kotlin/model/CommentTest.kt @@ -1,6 +1,8 @@ package model +import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DProperty +import org.jetbrains.dokka.model.doc.CodeBlock import org.jetbrains.dokka.model.doc.CustomTagWrapper import org.jetbrains.dokka.model.doc.Text import org.junit.jupiter.api.Test @@ -267,4 +269,39 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme } } } + + @Test + fun `should remove spaces inside indented code block`() { + inlineModelTest( + """ + |/** + | * Welcome: + | * + | * ```kotlin + | * fun main() { + | * println("Hello World!") + | * } + | * ``` + | * + | * fun thisIsACodeBlock() { + | * val butWhy = "per markdown spec, because four-spaces prefix" + | * } + | */ + |class Foo + """ + ) { + with((this / "comment" / "Foo").cast<DClass>()) { + docs()[0].children[2] equals CodeBlock( + listOf( + Text( + "fun thisIsACodeBlock() {\n" + + " val butWhy = \"per markdown spec, because four-spaces prefix\"\n" + + "}" + ) + ) + ) + } + } + } + } |