correctly serialize custom spans to html (#2199)

This commit is contained in:
Konrad Pozniak 2021-06-14 11:00:35 +02:00 committed by GitHub
commit 31da851f28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 62 deletions

View file

@ -117,8 +117,8 @@ private fun findEndOfPattern(string: String, result: FindCharsResult, pattern: P
private fun getSpan(matchType: FoundMatchType, string: String, colour: Int, start: Int, end: Int): CharacterStyle {
return when(matchType) {
FoundMatchType.HTTP_URL -> CustomURLSpan(string.substring(start, end))
FoundMatchType.HTTPS_URL -> CustomURLSpan(string.substring(start, end))
FoundMatchType.HTTP_URL -> NoUnderlineURLSpan(string.substring(start, end))
FoundMatchType.HTTPS_URL -> NoUnderlineURLSpan(string.substring(start, end))
else -> ForegroundColorSpan(colour)
}
}