Merge pull request 'Unescape parts in MensaParser' (#31) from unescape-mensa-parts into master
Reviewed-on: #31 Reviewed-by: Jannik <seil0@mosad.xyz>
This commit is contained in:
commit
bfd301e3a5
|
@ -24,6 +24,7 @@ package org.mosad.thecitadelofricks.hsoparser
|
||||||
|
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
|
import org.jsoup.parser.Parser
|
||||||
import org.mosad.thecitadelofricks.Meal
|
import org.mosad.thecitadelofricks.Meal
|
||||||
import org.mosad.thecitadelofricks.MensaWeek
|
import org.mosad.thecitadelofricks.MensaWeek
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
@ -66,7 +67,7 @@ class MensaParser {
|
||||||
|
|
||||||
day.select("div.menu-tagesplan > div.grid").first()?.select("div.flex-col")?.forEachIndexed { _, meal ->
|
day.select("div.menu-tagesplan > div.grid").first()?.select("div.flex-col")?.forEachIndexed { _, meal ->
|
||||||
val heading = meal.select("h5").text()
|
val heading = meal.select("h5").text()
|
||||||
val parts = ArrayList(meal.select("small.extra-text").html().split("<br>").map { it.trim() })
|
val parts = ArrayList(meal.select("small.extra-text").html().split("<br>").map { Parser.unescapeEntities(it, true).trim() })
|
||||||
val additives = meal.select("small.zusatzsstoffe[x-show=showAllergenes]").text()
|
val additives = meal.select("small.zusatzsstoffe[x-show=showAllergenes]").text()
|
||||||
parts.removeIf { x -> x.isEmpty() || x.isBlank() }
|
parts.removeIf { x -> x.isEmpty() || x.isBlank() }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue