🛠️ Fix issue with <p>
This commit is contained in:
parent
6f53811f68
commit
8966951303
1 changed files with 6 additions and 1 deletions
|
|
@ -35,7 +35,12 @@ class DocumentParser @Inject constructor(
|
||||||
|
|
||||||
body().apply {
|
body().apply {
|
||||||
// Remove manual line breaks from all <p>, <a>
|
// 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()
|
yield()
|
||||||
element.html(element.html().replace(Regex("\\n+"), ""))
|
element.html(element.html().replace(Regex("\\n+"), ""))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue