Markdown links allow tel:

Phone numbers can now be [+47 …](tel:+47…) links in descriptions,
same gate as https/mailto/relative.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y42TyF8Zu7NGRR2893vNcZ
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-01 21:48:25 +02:00
co-authored by Claude Fable 5
parent 2c94ba4379
commit c4609f4370
2 changed files with 6 additions and 1 deletions
Generated
+1 -1
View File
@@ -2948,7 +2948,7 @@ dependencies = [
[[package]]
name = "portal"
version = "0.3.28"
version = "0.3.30"
dependencies = [
"anyhow",
"arc-swap",
+5
View File
@@ -191,6 +191,7 @@ pub fn render_inline_markdown(text: &str) -> String {
Event::Start(Tag::Link { dest_url, .. })
if !(dest_url.starts_with("https://")
|| dest_url.starts_with("mailto:")
|| dest_url.starts_with("tel:")
|| dest_url.starts_with('/')) =>
{
in_link += 1;
@@ -2146,6 +2147,10 @@ alternatives:
fn markdown_drops_html_and_unsafe_links() {
assert_eq!(render_inline_markdown("x <script>y</script> z"), "x y z");
assert_eq!(render_inline_markdown("[bad](javascript:alert(1))"), "bad");
assert_eq!(
render_inline_markdown("[ring](tel:+4791180485)"),
"<a href=\"tel:+4791180485\">ring</a>"
);
assert_eq!(
render_inline_markdown("![site](https://x.no/a.jpg)"),
"<img src=\"https://x.no/a.jpg\" alt=\"site\" />"