diff options
author | vmishenev <vad-mishenev@yandex.ru> | 2021-08-09 12:32:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-09 11:32:08 +0200 |
commit | ec2bf8a57c744008c30d03c4aec0921a091faa81 (patch) | |
tree | 747f0ebd257f2e1644c9ab3fbd3f3452d3af7eab /plugins/base/src/test/kotlin | |
parent | bcebddee24d13b991c2afa2443689dc651539bb0 (diff) | |
download | dokka-ec2bf8a57c744008c30d03c4aec0921a091faa81.tar.gz dokka-ec2bf8a57c744008c30d03c4aec0921a091faa81.tar.bz2 dokka-ec2bf8a57c744008c30d03c4aec0921a091faa81.zip |
Keep formatting within code inline (#2060)
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r-- | plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt b/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt index 1a3bda5e..b44eb651 100644 --- a/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt +++ b/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt @@ -2,10 +2,7 @@ package content import junit.framework.Assert.assertEquals import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.jetbrains.dokka.model.doc.CustomDocTag -import org.jetbrains.dokka.model.doc.Description -import org.jetbrains.dokka.model.doc.P -import org.jetbrains.dokka.model.doc.Text +import org.jetbrains.dokka.model.doc.* import org.junit.jupiter.api.Test import kotlin.test.assertTrue @@ -110,4 +107,32 @@ class ContentInDescriptionTest : BaseAbstractTest() { } } } + + @Test + fun `text surrounded by angle brackets is not removed`() { + testInline( + """ + |/src/main/kotlin/sample/Foo.kt + |package sample + |/** + | * My example `CodeInline<Bar>` + | * ``` + | * CodeBlock<Bar> + | * ``` + | */ + |class Foo { + |} + """.trimIndent(), + configuration + ) { + documentablesMergingStage = { module -> + val cls = module.packages.flatMap { it.classlikes }.first { it.name == "Foo" } + val documentation = cls.documentation.values.first() + val docTags = documentation.children.single().root.children + + assertEquals("CodeInline<Bar>", ((docTags[0].children[1] as CodeInline).children.first() as Text).body) + assertEquals("CodeBlock<Bar>", ((docTags[1] as CodeBlock).children.first() as Text).body) + } + } + } }
\ No newline at end of file |