Skip to content

Commit

Permalink
Apply requested change
Browse files Browse the repository at this point in the history
Co-authored-by: Paweł Marks <Kordyjan@users.noreply.github.com>
  • Loading branch information
BarkingBad and Kordyjan committed Sep 14, 2020
1 parent 315e2c7 commit d810c77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/base/src/main/kotlin/parsers/MarkdownParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d810c77

Please sign in to comment.