some codestyle application

This commit is contained in:
dordsor21
2021-09-08 16:39:43 +01:00
parent dc11b74020
commit 195a13a23c
92 changed files with 465 additions and 291 deletions

View File

@ -291,10 +291,10 @@ Other Permissions
}
private fun String.makeRstSafe(lineJoiner: String) = trim()
.replace("\"", "\\\"").replace("\n", "\n" + " ".repeat(2))
.lineSequence()
.map { line -> line.ifBlank { "" } }
.joinToString(separator = lineJoiner)
.replace("\"", "\\\"").replace("\n", "\n" + " ".repeat(2))
.lineSequence()
.map { line -> line.ifBlank { "" } }
.joinToString(separator = lineJoiner)
private fun linkSafe(text: String) = text.replace(" ", "-")

View File

@ -53,8 +53,8 @@ private fun formatAsRst(component: Component, currentDeco: String? = null): Char
deco?.let {
require(currentDeco == null) {
"Nested decorations are hell in RST. \n" +
"Existing: $currentDeco; New: $deco\n" +
"Offender: ${TextHelper.reduceToText(component)}"
"Existing: $currentDeco; New: $deco\n" +
"Offender: ${TextHelper.reduceToText(component)}"
}
content.rstDeco(deco)
}