aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main
diff options
context:
space:
mode:
authorAndrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com>2020-09-14 13:43:22 +0200
committerAndrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com>2020-09-14 13:44:34 +0200
commitd810c7782814697bb65d078432cd2ace84748a21 (patch)
treec08e16591d1287b5a2916bca3bb14658b8d51844 /plugins/base/src/main
parent315e2c7a56450eb24a5d5e4e526c36ead8d10965 (diff)
downloaddokka-d810c7782814697bb65d078432cd2ace84748a21.tar.gz
dokka-d810c7782814697bb65d078432cd2ace84748a21.tar.bz2
dokka-d810c7782814697bb65d078432cd2ace84748a21.zip
Apply requested change
Co-authored-by: Paweł Marks <Kordyjan@users.noreply.github.com>
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r--plugins/base/src/main/kotlin/parsers/MarkdownParser.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt
index 3fc570a0..d0fd124c 100644
--- a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt
+++ b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt
@@ -369,7 +369,7 @@ class MarkdownParser(
private fun List<DocTag>.trimSurroundingTokensIfText() = mapIndexed { index, elem ->
val elemTransformed = if (index == 0 && elem is Text) elem.copy(elem.body.trimStart()) else elem
- if (index == size - 1 && elemTransformed is Text) elemTransformed.copy(elemTransformed.body.trimEnd()) else elemTransformed
+ if (index == lastIndex && elemTransformed is Text) elemTransformed.copy(elemTransformed.body.trimEnd()) else elemTransformed
}
private val notLeafNodes = listOf(MarkdownTokenTypes.HORIZONTAL_RULE, MarkdownTokenTypes.HARD_LINE_BREAK)