0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-26 11:24:35 +01:00
gitea/modules
Alexander Scheel ee7df7ba8c Markdown: Sanitizier Configuration (#9075)
* Support custom sanitization policy

Allowing the gitea administrator to configure sanitization policy allows
them to couple external renders and custom templates to support more
markup. In particular, the `pandoc` renderer allows generating KaTeX
annotations, wrapping them in `<span>` elements with class `math` and
either `inline` or `display` (depending on whether or not inline or
block mode was requested).

This iteration gives the administrator whitelisting powers; carefully
crafted regexes will thus let through only the desired attributes
necessary to support their custom markup.

Resolves: #9054

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>

* Document new sanitization configuration

 - Adds basic documentation to app.ini.sample,
 - Adds an example to the Configuration Cheat Sheet, and
 - Adds extended information to External Renderers section.

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>

* Drop extraneous length check in newMarkupSanitizer(...)

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>

* Fix plural ELEMENT and ALLOW_ATTR in docs

These were left over from their initial names. Make them singular to
conform with the current expectations.

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
2019-12-07 14:49:04 -05:00
..
auth Branch protection: Possibility to not use whitelist but allow anyone with write access (#9055) 2019-12-03 20:08:56 -05:00
avatar
base
cache
charset
context Fix nil context user (#9099) 2019-11-20 19:44:35 +00:00
convert [Bug] [API] Add language to user api (#9215) 2019-11-30 11:18:40 -05:00
cron
generate
git Graceful: Cancel Process on monitor pages & HammerTime (#9213) 2019-11-30 16:40:22 +02:00
gitgraph Move git graph from models to modules/graph (#9027) 2019-11-16 08:47:57 +08:00
graceful Add comment to exported function WindowsServiceName (make revive) (#9241) 2019-12-03 19:16:29 -05:00
highlight
httplib
indexer upgrade levelqueue to 0.1.0 (#9192) 2019-11-28 23:37:33 +08:00
lfs
log
markup Markdown: Sanitizier Configuration (#9075) 2019-12-07 14:49:04 -05:00
metrics
migrations Add retry for migration http/https requests (#9019) 2019-11-16 16:30:06 +08:00
notification Move mirror sync actions to notification (#9022) 2019-11-24 00:16:59 -05:00
options
password Add password requirement info on error (#9074) 2019-11-19 22:44:58 +00:00
pprof
private
process Graceful: Cancel Process on monitor pages & HammerTime (#9213) 2019-11-30 16:40:22 +02:00
public
recaptcha fixed reCAPTCHA URL (#9083) 2019-11-22 08:03:45 +00:00
references Alternate syntax for cross references (#9116) 2019-12-01 15:57:05 +02:00
repofiles Move UpdateIssuesCommit from models to repofiles (#9276) 2019-12-07 23:52:36 +08:00
search
secret
session
setting Markdown: Sanitizier Configuration (#9075) 2019-12-07 14:49:04 -05:00
ssh Add Graceful shutdown for Windows and hooks for shutdown of goroutines (#8964) 2019-11-21 13:32:02 -05:00
structs Add release_counter to Repo API (#9214) 2019-11-30 14:28:47 -05:00
sync
task
templates Add USE_SERVICE_WORKER setting (#9110) 2019-11-21 15:06:23 -05:00
test
timeutil
upload
user
util
validation Implement webhook branch filter (#7791) 2019-09-09 08:48:21 +03:00
webhook Make consistent links to repository in the Slack/Mattermost notificiations (#9205) 2019-11-30 12:23:37 +02:00