mattermost-mobile-upstream/app/components/markdown
Joram Wilander 6ec7bef334
MM-70688 Autolink phone numbers in posts as tel: links (#10143)
* Add phone number matching helpers for tel: autolinks.

Detect E.164, grouped national numbers, and tel: URIs while skipping
bare digit runs that look like ticket IDs or dates.

Co-authored-by: joram <joram@mattermost.com>

* Autolink phone numbers in post markdown as tel: links.

Wrap recognized numbers in markdown link nodes after parsing so tapping
opens the device dialer. Skip code, existing links, and unsafe posts.

Co-authored-by: joram <joram@mattermost.com>

* Copy phone numbers from tel: markdown links on long-press.

Treat tel: like mailto: in link and channel-header sheets, and cover
opening tel: URLs through the existing openLink path.

Co-authored-by: joram <joram@mattermost.com>

* Reject truncated phone matches inside longer digit sequences.

Skip past hyphens and dots when checking match boundaries so overlong
numbers and numeric prefixes are not autolinked. Keep spaces and
parentheses as boundaries so adjacent numbers still match.

Also address CodeRabbit test nits: assert match counts, prefix
autolinkPhoneNumbers cases with should, and assert rendered tel: links.

Co-authored-by: joram <joram@mattermost.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-14 14:32:17 -04:00
..
at_mention Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
channel_mention Improve markdown code (#9164) 2025-11-04 10:05:56 +01:00
hashtag Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
inline_action_button Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
inline_entity_link [MM-66591] Channel Summaries with Agents (#9405) 2026-02-13 07:00:43 -05:00
markdown_block_quote Update dependencies and upgrade to RN 0.76.5 (#8421) 2025-01-16 07:11:32 -07:00
markdown_code_block Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_image Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_latex_block Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_latex_inline Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_link MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00
markdown_list Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_list_item Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
markdown_table fix: Product fixes to run e2e tests (#10081) 2026-08-26 16:12:37 +05:30
markdown_table_cell Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_table_image feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
markdown_table_row Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
error_boundary.tsx [MM-69457] Stop logging PII in exportable app logs (#9884) 2026-07-02 12:19:04 +02:00
index.ts feat: add minimumHashtagLength to Markdown observables (#8924) 2025-06-17 09:53:11 +02:00
markdown.test.tsx MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00
markdown.tsx MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00
transform.test.ts MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00
transform.ts MM-70688 Autolink phone numbers in posts as tel: links (#10143) 2026-09-14 14:32:17 -04:00