🛠️ Fix issue with <p>

This commit is contained in:
Acclorite 2025-01-15 13:10:41 +02:00
parent 6f53811f68
commit 8966951303

View file

@ -35,7 +35,12 @@ class DocumentParser @Inject constructor(
body().apply {
// Remove manual line breaks from all <p>, <a>
select("p, a").forEach { element ->
select("p").forEach { element ->
yield()
element.html(element.html().replace(Regex("\\n+"), " "))
element.append("\n")
}
select("a").forEach { element ->
yield()
element.html(element.html().replace(Regex("\\n+"), ""))
}