Yarden Shoham
f5ce2ed292
Allow all URL schemes in Markdown links by default ( #24805 )
...
- Closes #21146
- Closes #16721
## ⚠️ BREAKING ⚠️
This changes the default behavior to now create links for any URL scheme
when the user uses the markdown form for links (`[label](URL)`), this
doesn't affect the rendering of inline links. To opt-out set the
`markdown.CUSTOM_URL_SCHEMES` setting to a list of allowed schemes, all
other schemes (except `http` and `https`) won't be allowed.
# Before
![image](https://github.com/go-gitea/gitea/assets/20454870/35fa18ce-7dda-4995-b5b3-3f360f38296d )
# After
![image](https://github.com/go-gitea/gitea/assets/20454870/0922216b-0b35-4b77-9919-21a5c21dd5d0 )
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
flynnnnnnnnnn
e81ccc406b
Implement FSFE REUSE for golang files ( #21840 )
...
Change all license headers to comply with REUSE specification.
Fix #16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2 years ago
Gusted
edd945bca3
Allow to specify colors for text in markup ( #20363 )
...
`<span style="color: red">Hello World!</span>` will now be accepted by
Bluemonday, other properties are still disallowed by Bluemonday.
2 years ago
Wim
cb50375e2b
Add more linters to improve code readability ( #19989 )
...
Add nakedret, unconvert, wastedassign, stylecheck and nolintlint linters to improve code readability
- nakedret - https://github.com/alexkohler/nakedret - nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length.
- unconvert - https://github.com/mdempsky/unconvert - Remove unnecessary type conversions
- wastedassign - https://github.com/sanposhiho/wastedassign - wastedassign finds wasted assignment statements.
- notlintlint - Reports ill-formed or insufficient nolint directives
- stylecheck - https://staticcheck.io/docs/checks/#ST - keep style consistent
- excluded: [ST1003 - Poorly chosen identifier](https://staticcheck.io/docs/checks/#ST1003 ) and [ST1005 - Incorrectly formatted error string](https://staticcheck.io/docs/checks/#ST1005 )
2 years ago
6543
54e9ee37a7
format with gofumpt ( #18184 )
...
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
3 years ago
KN4CK3R
21cde5c439
Fix data URI scramble ( #16098 )
...
* Removed unused method.
* No prefix for data uris.
* Added test to prevent regressions.
4 years ago
zeripath
04196b7658
Update to bluemonday-1.0.6 ( #15294 )
...
Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago
silverwind
41e8b834af
Markdown task list improvements ( #13952 )
...
* Markdown task list improvements
- Remove `.ui` class and wrappers to prevent fomantic from messing with it.
- Change rendered HTML to match GitHub.
- Add custom styling for the checkboxes.
* fix unittest
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago
zeripath
ce66ca7f9f
Restore checkbox rendering and prevent poor sanitization of spans ( #11277 )
...
* Add test
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Restore checkbox rendering and prevent poor sanitization of spans
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Also fix preview context
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Also fix preview context
Signed-off-by: Andrew Thornton <art27@cantab.net>
5 years ago
John Olheiser
9a33adcdd3
Allow kbd tags ( #9245 )
...
* Allow kbd tags
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add test
Signed-off-by: jolheiser <john.olheiser@gmail.com>
5 years ago
Lunny Xiao
52e11b24bf
Restructure markup & markdown to prepare for multiple markup language… ( #2411 )
...
* restructure markup & markdown to prepare for multiple markup languages support
* adjust some functions between markdown and markup
* fix tests
* improve the comments
7 years ago
Kim "BKC" Carlbäcker
d409d3ab57
Sanitation fix from Gogs ( #1461 )
...
* Santiation fix from Gogs
* Linting
* Fix build-errors
* still not working
* Fix all the things!
* gofmt
* Add code-injection checks
8 years ago