Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
fix missing post description wrapping lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
WhichWho committed Jul 31, 2022
1 parent 91922fb commit 9a44e2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/kotlin/loli/ball/kemono/factory/PostFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import loli.ball.kemono.dateParser
import loli.ball.kemono.pictureCountRegexp
import loli.ball.kemono.rangeRegexp
import org.jsoup.Jsoup
import org.jsoup.nodes.Document

object PostFactory {

Expand Down Expand Up @@ -94,6 +95,7 @@ object PostFactory {
*/
fun parsePost(html: String): Post {
val doc = Jsoup.parse(html)
doc.outputSettings(Document.OutputSettings().prettyPrint(false))

var service = ""
var user = ""
Expand All @@ -111,7 +113,7 @@ object PostFactory {

val name = doc.select("#page > header > div.post__info > h1.post__title > span:nth-child(1)").text()
val time = doc.select("#page > header > div.post__info > div.post__published > time").attr("datetime")
val desc = doc.select("#page > div > div.post__content").text()
val desc = doc.select("#page > div > div.post__content").html().trim()
val timestamp = if (time.isNotBlank()) dateParser.parse(time).time else 0

val files = mutableListOf<RemoteFile>()
Expand Down

0 comments on commit 9a44e2d

Please sign in to comment.