forked from forgejo/forgejo
Make short link pattern greedy (#2259)
Multiple links on the same line are currently not recognized correctly.
This commit is contained in:
parent
a3262636b8
commit
d05150a331
2 changed files with 7 additions and 1 deletions
|
@ -64,7 +64,7 @@ var (
|
|||
Sha1CurrentPattern = regexp.MustCompile(`(?:^|\s|\()([0-9a-f]{7,40})\b`)
|
||||
|
||||
// ShortLinkPattern matches short but difficult to parse [[name|link|arg=test]] syntax
|
||||
ShortLinkPattern = regexp.MustCompile(`(\[\[.*\]\]\w*)`)
|
||||
ShortLinkPattern = regexp.MustCompile(`(\[\[.*?\]\]\w*)`)
|
||||
|
||||
// AnySHA1Pattern allows to split url containing SHA into parts
|
||||
AnySHA1Pattern = regexp.MustCompile(`(http\S*)://(\S+)/(\S+)/(\S+)/(\S+)/([0-9a-f]{40})(?:/?([^#\s]+)?(?:#(\S+))?)?`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue