mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 03:04:21 +01:00
🎨 Improve auto email link parsing https://github.com/siyuan-note/siyuan/issues/16629
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
a3548825e3
commit
7679adf6d5
1 changed files with 8 additions and 0 deletions
|
|
@ -165,6 +165,14 @@ func IsRelativePath(dest string) bool {
|
|||
if '/' == dest[0] {
|
||||
return false
|
||||
}
|
||||
|
||||
// 检查特定协议前缀
|
||||
lowerDest := strings.ToLower(dest)
|
||||
if strings.HasPrefix(lowerDest, "mailto:") ||
|
||||
strings.HasPrefix(lowerDest, "tel:") ||
|
||||
strings.HasPrefix(lowerDest, "sms:") {
|
||||
return false
|
||||
}
|
||||
return !strings.Contains(dest, ":/") && !strings.Contains(dest, ":\\")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue