mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-04 18:43:31 +02:00
incremented matching group due to added matching group
added nbsp entity
This commit is contained in:
@@ -141,6 +141,8 @@ object MetaTagsParser {
|
|||||||
"LT" to "<",
|
"LT" to "<",
|
||||||
"gt" to ">",
|
"gt" to ">",
|
||||||
"GT" to ">",
|
"GT" to ">",
|
||||||
|
"nbsp" to " ",
|
||||||
|
"NBSP" to " ",
|
||||||
)
|
)
|
||||||
val CHAR_REFS =
|
val CHAR_REFS =
|
||||||
mapOf(
|
mapOf(
|
||||||
@@ -157,6 +159,7 @@ object MetaTagsParser {
|
|||||||
"mdash" to "—",
|
"mdash" to "—",
|
||||||
"hellip" to "…",
|
"hellip" to "…",
|
||||||
"x27" to "'",
|
"x27" to "'",
|
||||||
|
"nbsp" to " ",
|
||||||
)
|
)
|
||||||
|
|
||||||
fun replaceCharRefs(match: MatchResult): String {
|
fun replaceCharRefs(match: MatchResult): String {
|
||||||
@@ -165,7 +168,7 @@ object MetaTagsParser {
|
|||||||
return bcr
|
return bcr
|
||||||
}
|
}
|
||||||
// non-base char refs must be terminated by ';'
|
// non-base char refs must be terminated by ';'
|
||||||
if (match.groupValues[2].isNotEmpty()) {
|
if (match.groupValues[3].isNotEmpty()) {
|
||||||
val cr = CHAR_REFS[match.groupValues[2]]
|
val cr = CHAR_REFS[match.groupValues[2]]
|
||||||
if (cr != null) {
|
if (cr != null) {
|
||||||
return cr
|
return cr
|
||||||
|
Reference in New Issue
Block a user