From 0c2fd3adc0ea5c3000fa3027cb57053e9e7008d2 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sun, 22 Jan 2023 19:07:06 -0300 Subject: [PATCH] Doesn't try to link phone numbers smaller than 6 chars --- .../com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt index b7c013ecf0..fe8364c6e0 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt @@ -62,7 +62,7 @@ fun RichTextViewer(content: String, tags: List>?, note: Note, accou } } else if (Patterns.EMAIL_ADDRESS.matcher(word).matches()) { ClickableEmail(word) - } else if (Patterns.PHONE.matcher(word).matches()) { + } else if (Patterns.PHONE.matcher(word).matches() && word.length > 6) { ClickablePhone(word) } else if (noProtocolUrlValidator.matcher(word).matches()) { UrlPreview("https://$word", word)