summaryrefslogtreecommitdiffstats
path: root/modules/markdown/markdown.go
diff options
context:
space:
mode:
authorMichael Kuhn <suraia@ikkoku.de>2017-08-05 23:52:19 +0200
committerLauris BH <lauris@nix.lv>2017-08-06 00:52:19 +0300
commitd05150a3317766863586b3a5b2a6a09feab3dd8c (patch)
treea9288ba289ff40d6892c22a709c2125c2bfd7f89 /modules/markdown/markdown.go
parenta3262636b87477b22e37cdbd562f260b4c4a8c25 (diff)
downloadgitea-d05150a3317766863586b3a5b2a6a09feab3dd8c.tar.gz
gitea-d05150a3317766863586b3a5b2a6a09feab3dd8c.zip
Make short link pattern greedy (#2259)
Multiple links on the same line are currently not recognized correctly.
Diffstat (limited to 'modules/markdown/markdown.go')
-rw-r--r--modules/markdown/markdown.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/markdown/markdown.go b/modules/markdown/markdown.go
index bebf454ff1..898df59292 100644
--- a/modules/markdown/markdown.go
+++ b/modules/markdown/markdown.go
@@ -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+))?)?`)