mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-18 03:17:56 +01: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.go | ||
markdown_test.go | ||
sanitizer.go | ||
sanitizer_test.go |