Skip to content

Commit 3430cf8

Browse files
authored
🐞 bounded lists with unregular characters in the liste name (#218)
Parent issue: sequentech/meta#4182
1 parent 7a4130e commit 3430cf8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/models/Models.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import play.api.db.slick.Config.driver.simple._
2828
import scala.slick.lifted.Tag
2929
import play.api.libs.json._
3030

31+
import org.apache.commons.text.StringEscapeUtils
3132
import java.sql.Timestamp
3233
import java.util.Date
3334

@@ -861,7 +862,11 @@ case class Question(
861862
url => (url.url == "true" && url.title == "isCategoryList")
862863
}.length > 0
863864
}
864-
.map { answer => answer.text.replace("&", "&").replace("+", "+") }
865+
.map { answer =>
866+
answer.copy(
867+
text = StringEscapeUtils.unescapeHtml4(answer.text)
868+
)
869+
}
865870
.toSet
866871
assert(
867872
categoryNames == answerCategoryNames,

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ libraryDependencies ++= Seq(
4343
jdbc,
4444
cache,
4545
ws,
46+
"org.apache.commons" % "commons-text" % "1.10.0",
4647
"com.typesafe.play" %% "play-slick" % "0.8.0",
4748
"org.postgresql" % "postgresql" % "42.7.2",
4849
"org.bouncycastle" % "bcprov-jdk15to18" % "1.76",

0 commit comments

Comments
 (0)