diff options
author | Andrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com> | 2020-10-08 20:25:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 20:25:06 +0200 |
commit | 75f572b271c5959bd6fab0b51cef792fa403ea83 (patch) | |
tree | 5a3fb52df075268d8ff642cf52e6b342debcee1f /plugins/base/src/test | |
parent | 58a76b4031953355e38cb534ab02c159f7cfb726 (diff) | |
download | dokka-75f572b271c5959bd6fab0b51cef792fa403ea83.tar.gz dokka-75f572b271c5959bd6fab0b51cef792fa403ea83.tar.bz2 dokka-75f572b271c5959bd6fab0b51cef792fa403ea83.zip |
Fix multiline links in javadoc and wrong linebreaking of <pre> bodies (#1518)
* Fix multiline links in javadoc
* Fix wrong linebreaking of <pre> bodies
* Use included static values for external links
Co-authored-by: Marcin Aman <marcin.aman@gmail.com>
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r-- | plugins/base/src/test/kotlin/translators/JavadocParserTest.kt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt index 762c2e27..df5b6dae 100644 --- a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt +++ b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt @@ -114,6 +114,14 @@ class JavadocParserTest : AbstractCoreTest() { | * not fall within the indicated ranges; for example, a date may be | * specified as January 32 and is interpreted as meaning February 1. | * + | * <pre class="prettyprint"> + | * class MyFragment extends Fragment { + | * public MyFragment() { + | * super(R.layout.fragment_main); + | * } + | * } + | * </pre> + | | * @author James Gosling | * @author Arthur van Hoff | * @author Alan Liu @@ -178,4 +186,19 @@ class JavadocParserTest : AbstractCoreTest() { assertEquals(expectedText.trim(), preTagContent.body.trim()) } } + + @Test + fun `correctly parsed code block with curly braces (which PSI has problem with)`() { + performJavadocTest { module -> + val dateDescription = module.descriptionOf("Date2")!! + val preTagContent = dateDescription.childrenOfType<Pre>()[1].firstChildOfType<Text>() + val expectedText = """class MyFragment extends Fragment { + public MyFragment() { + super(R.layout.fragment_main); + } +}""".trimIndent() + assertEquals(expectedText.trim(), preTagContent.body.trim()) + } + } + } |