From faff0733e94e9b078751419a1f95ddd459be63a7 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Fri, 29 Dec 2023 21:52:26 +0800 Subject: [PATCH] Fix unintended spaces in comments --- .../com/hippo/ehviewer/client/parser/GalleryDetailParser.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/client/parser/GalleryDetailParser.kt b/app/src/main/kotlin/com/hippo/ehviewer/client/parser/GalleryDetailParser.kt index 537b456f7..5da09d848 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/client/parser/GalleryDetailParser.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/client/parser/GalleryDetailParser.kt @@ -93,8 +93,7 @@ object GalleryDetailParser { // Error info PATTERN_ERROR.find(body)?.run { throw EhException(groupValues[1]) } - // Temporary workaround, see https://github.com/jhy/jsoup/issues/1850 - val document = Jsoup.parse(body.replace("del>", "s>")) + val document = Jsoup.parse(body) val galleryDetail = GalleryDetail( tags = parseTagGroups(document), comments = parseComments(document), @@ -412,6 +411,8 @@ object GalleryDetailParser { * Parse comments with html parser */ suspend fun parseComments(document: Document): GalleryCommentList { + // Disable pretty print to get comments in raw html + document.outputSettings().prettyPrint(false) return try { val cdiv = document.getElementById("cdiv")!! val c1s = cdiv.getElementsByClass("c1")