summaryrefslogtreecommitdiff
path: root/src/library/text.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-25 14:08:30 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-26 14:51:57 +0200
commit1ca4ff69e235ca6dde9ef498a8377d0586f2519c (patch)
treeef7c8a1c1f18d5b2a3ed25b8355b8f84dc35a3fa /src/library/text.rs
parent5e34c81a0161d5f0649970fcb980d96ede24f853 (diff)
Trim `mailto:` and `tel:` from links
Diffstat (limited to 'src/library/text.rs')
-rw-r--r--src/library/text.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/text.rs b/src/library/text.rs
index 23d74938..e4d52396 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -199,7 +199,7 @@ pub fn link(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
let url = args.expect::<Str>("url")?;
let body = args.find().unwrap_or_else(|| {
let mut template = Template::new();
- template.text(&url);
+ template.text(url.trim_start_matches("mailto:").trim_start_matches("tel:"));
template
});