Unescape any escaped character in article text

Apply the general DSL rule \X -> X instead of unescaping only brackets
and parentheses, so sequences like \! no longer show the backslash.
This commit is contained in:
2026-08-18 00:15:53 +03:00
parent f751ac0d36
commit 457bbe43b6
@@ -23,7 +23,6 @@ object DslAnnotatedParser {
"br", "p", "b", "i", "c", "t", "m", "m0", "m1", "m2", "m3", "m4", "m5", "br", "p", "b", "i", "c", "t", "m", "m0", "m1", "m2", "m3", "m4", "m5",
"ref", "ex", "e", "trn", "com", "lang", "sup", "'" "ref", "ex", "e", "trn", "com", "lang", "sup", "'"
) )
private val ESCAPED_CHARS = setOf('[', ']', '(', ')')
data class ColorScheme( data class ColorScheme(
val secondaryText: Color, val secondaryText: Color,
@@ -101,7 +100,6 @@ object DslAnnotatedParser {
'\\' -> { '\\' -> {
if (i + 1 < length) { if (i + 1 < length) {
val next = dsl[i + 1] val next = dsl[i + 1]
if (next in ESCAPED_CHARS) {
builder.append(next) builder.append(next)
if (refStack.isNotEmpty()) { if (refStack.isNotEmpty()) {
refStack.last().second.append(next) refStack.last().second.append(next)
@@ -110,7 +108,6 @@ object DslAnnotatedParser {
i += 2 i += 2
continue continue
} }
}
builder.append(char) builder.append(char)
if (refStack.isNotEmpty()) { if (refStack.isNotEmpty()) {
refStack.last().second.append(char) refStack.last().second.append(char)