Skip to content
Snippets Groups Projects
Verified Commit be3b1d9e authored by Mikolai Gütschow's avatar Mikolai Gütschow
Browse files

remove redundant regex call since Jsoup already combines whitespaces for us

parent 89629bae
No related branches found
No related tags found
1 merge request!366Add support for HTML blog posts
Pipeline #15429 passed
...@@ -318,8 +318,6 @@ fun HtmlText( ...@@ -318,8 +318,6 @@ fun HtmlText(
val text = val text =
if (withinPre) node.wholeText if (withinPre) node.wholeText
else node.text() else node.text()
// replace multiple newlines/whitespaces to single whitespace
.replace("\\s+".toRegex(), " ")
// remove whitespace if first character in new line // remove whitespace if first character in new line
.let { if (lastCharWasNewline) it.trimStart() else it } .let { if (lastCharWasNewline) it.trimStart() else it }
if (text.isNotBlank()) { if (text.isNotBlank()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment