mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-06-29 00:12:52 +00:00
Handle anchored links correctly
This commit is contained in:
parent
f3c4a45c3d
commit
140d97ddf4
@ -97,6 +97,11 @@ func From(address, display, hyphaName string) *Link {
|
|||||||
link.Display = strings.TrimSpace(display)
|
link.Display = strings.TrimSpace(display)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pos := strings.IndexRune(address, '#'); pos != -1 {
|
||||||
|
link.Anchor = address[pos:]
|
||||||
|
address = address[:pos]
|
||||||
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case strings.ContainsRune(address, ':'):
|
case strings.ContainsRune(address, ':'):
|
||||||
pos := strings.IndexRune(address, ':')
|
pos := strings.IndexRune(address, ':')
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit e7040f3e0dc41809063b77fcbc12fe33b234ea87
|
Subproject commit 133b2689fbd67cad274f1c10fc6cbe8adbfc156a
|
Loading…
x
Reference in New Issue
Block a user