1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-01-27 09:11:23 +01:00

support some html tags

This commit is contained in:
tateisu 2021-01-29 21:59:27 +09:00
parent 832fa23698
commit 6676b9b41f
2 changed files with 1106 additions and 808 deletions

File diff suppressed because it is too large Load Diff

View File

@ -80,7 +80,19 @@ object CharacterGroup {
)
"[${quotedKeys}]+".asciiPattern()
}
internal val reNotWhitespace by lazy {
val quotedKeys = Pattern.quote(
StringBuilder().apply {
val size = mapWhitespace.size()
ensureCapacity(size)
for(i in 0 until size) {
append(mapWhitespace.keyAt(i).toChar())
}
}.toString()
)
"[^${quotedKeys}]+".asciiPattern()
}
private fun SparseBooleanArray.keys() = (0 until size()).map { keyAt(it) }
internal val reWhitespaceBeforeLineFeed by lazy {