mirror of
https://github.com/go-gitea/gitea
synced 2024-11-13 21:54:24 +00:00
89845f6728
This changes the regex to look for a hash from 7 to 40 characters,
to match the use of abbreviated hash lookups in both git and github.
The restriction of not being a pure number is also removed because
1234567 is now considered a valid abbreviated hash, as is deadbeef.
A note has been added to the top of the code to state that the
literal regex match is fine, but no extra validation is currently
performed so some false positives are expected.
A future change could ensure that the hash exists in the repository
before rendering it as a link, although this might incur a slight
performance penalty.
Reverts part of commit
|
||
---|---|---|
.. | ||
markdown_test.go | ||
markdown.go | ||
sanitizer_test.go | ||
sanitizer.go |