diff options
author | Andrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com> | 2020-09-14 13:43:22 +0200 |
---|---|---|
committer | Andrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com> | 2020-09-14 13:44:34 +0200 |
commit | d810c7782814697bb65d078432cd2ace84748a21 (patch) | |
tree | c08e16591d1287b5a2916bca3bb14658b8d51844 | |
parent | 315e2c7a56450eb24a5d5e4e526c36ead8d10965 (diff) | |
download | dokka-d810c7782814697bb65d078432cd2ace84748a21.tar.gz dokka-d810c7782814697bb65d078432cd2ace84748a21.tar.bz2 dokka-d810c7782814697bb65d078432cd2ace84748a21.zip |
Apply requested change
Co-authored-by: Paweł Marks <Kordyjan@users.noreply.github.com>
-rw-r--r-- | plugins/base/src/main/kotlin/parsers/MarkdownParser.kt | 2 |
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) |