diff options
author | Nuno Silva <nuno-silva@users.noreply.github.com> | 2021-01-03 15:11:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-03 23:11:10 +0800 |
commit | 44ff1d6a1e20694b678ba53b0f1e03e9c7c5b8a6 (patch) | |
tree | 96e381eb5e798080509e2c588a83dfd17770dfb7 /modules/markup/html.go | |
parent | 7576e37a65729363370d6672ff6e69e87b68ac5f (diff) | |
download | gitea-44ff1d6a1e20694b678ba53b0f1e03e9c7c5b8a6.tar.gz gitea-44ff1d6a1e20694b678ba53b0f1e03e9c7c5b8a6.zip |
Render links for commit hashes followed by comma (#14224)
Regex test cases: https://regex101.com/r/mVbPxM/2/
fixes #14223
Diffstat (limited to 'modules/markup/html.go')
-rw-r--r-- | modules/markup/html.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/markup/html.go b/modules/markup/html.go index 7ac23d0503..9e4b1a3d5d 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -43,7 +43,7 @@ var ( // sha1CurrentPattern matches string that represents a commit SHA, e.g. d8a994ef243349f321568f9e36d5c3f444b99cae // Although SHA1 hashes are 40 chars long, the regex matches the hash from 7 to 40 chars in length // so that abbreviated hash links can be used as well. This matches git and github useability. - sha1CurrentPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([0-9a-f]{7,40})(?:\s|$|\)|\]|\.(\s|$))`) + sha1CurrentPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([0-9a-f]{7,40})(?:\s|$|\)|\]|[.,](\s|$))`) // shortLinkPattern matches short but difficult to parse [[name|link|arg=test]] syntax shortLinkPattern = regexp.MustCompile(`\[\[(.*?)\]\](\w*)`) |