Refactor markup rendering to accept general "protocol:" prefix (#29276)
Follow #29024 Major changes: * refactor validLinksPattern to fullURLPattern and add comments, now it accepts "protocol:" prefix * rename `IsLink*` to `IsFullURL*`, and remove unnecessray "mailto:" check * fix some comments (by the way) * rename EmojiShortCodeRegex -> emojiShortCodeRegex (by the way)
This commit is contained in:
parent
4e536edaea
commit
6130522aa8
4 changed files with 38 additions and 32 deletions
|
@ -136,8 +136,7 @@ type Writer struct {
|
|||
func (r *Writer) resolveLink(kind, link string) string {
|
||||
link = strings.TrimPrefix(link, "file:")
|
||||
if !strings.HasPrefix(link, "#") && // not a URL fragment
|
||||
!markup.IsLinkStr(link) && // not an absolute URL
|
||||
!strings.HasPrefix(link, "mailto:") {
|
||||
!markup.IsFullURLString(link) {
|
||||
if kind == "regular" {
|
||||
// orgmode reports the link kind as "regular" for "[[ImageLink.svg][The Image Desc]]"
|
||||
// so we need to try to guess the link kind again here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue