in richtext-ui/src/commonMain/kotlin/com/halilibo/richtext/ui/string/RichTextString.kt [248:259]
fun findTag(
tag: String,
tags: Map<String, Any>
): Format? {
val stripped = tag.removePrefix("format:")
return if (stripped === tag) {
// If the original string was returned, it means the string did not have the prefix.
simpleTags.firstOrNull { it.simpleTag == tag }
} else {
tags[stripped] as? Format
}
}