+14
appview/pages/markup/extension/atlink.go
+14
appview/pages/markup/extension/atlink.go
···
36
36
}
37
37
38
38
var atRegexp = regexp.MustCompile(`(^|\s|\()(@)([a-zA-Z0-9.-]+)(\b)`)
39
+
var markdownLinkRegexp = regexp.MustCompile(`(?ms)\[.*\]\(.*\)`)
39
40
40
41
type atParser struct{}
41
42
···
55
56
if m == nil {
56
57
return nil
57
58
}
59
+
60
+
if !util.IsSpaceRune(block.PrecendingCharacter()) {
61
+
return nil
62
+
}
63
+
64
+
// Check for all links in the markdown to see if the handle found is inside one
65
+
linksIndexes := markdownLinkRegexp.FindAllIndex(block.Source(), -1)
66
+
for _, linkMatch := range linksIndexes {
67
+
if linkMatch[0] < segment.Start && segment.Start < linkMatch[1] {
68
+
return nil
69
+
}
70
+
}
71
+
58
72
atSegment := text.NewSegment(segment.Start, segment.Start+m[1])
59
73
block.Advance(m[1])
60
74
node := &AtNode{}
+1
-1
appview/pages/templates/strings/string.html
+1
-1
appview/pages/templates/strings/string.html
···
17
17
<span class="select-none">/</span>
18
18
<a href="/strings/{{ $ownerId }}/{{ .String.Rkey }}" class="font-bold">{{ .String.Filename }}</a>
19
19
</div>
20
-
<div class="flex gap-2 text-base">
20
+
<div class="flex gap-2 items-stretch text-base">
21
21
{{ if and .LoggedInUser (eq .LoggedInUser.Did .String.Did) }}
22
22
<a class="btn flex items-center gap-2 no-underline hover:no-underline p-2 group"
23
23
hx-boost="true"