You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/doc/advanced/external-renderers.en-us.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,4 +68,22 @@ RENDER_COMMAND = rst2html.py
68
68
IS_INPUT_FILE = false
69
69
```
70
70
71
+
If your external markup relies on additional classes and attributes on the generated HTML elements, you might need to enable custom sanitizer policies. Gitea uses the [`bluemonday`](https://godoc.org/github.com/microcosm-cc/bluemonday) package as our HTML sanitizier. The example below will support [KaTeX](https://katex.org/) output from [`pandoc`](https://pandoc.org/).
72
+
73
+
```ini
74
+
[markup.sanitizer]
75
+
; Pandoc renders TeX segments as <span>s with the "math" class, optionally
76
+
; with "inline" or "display" classes depending on context.
RENDER_COMMAND = pandoc -f markdown -t html --katex
85
+
```
86
+
87
+
You may redefine `ELEMENT`, `ALLOW_ATTR`, and `REGEXP` multiple times; each time all three are defined is a single policy entry. All three must be defined, but `REGEXP` may be blank to allow unconditional whitelisting of that attribute.
88
+
71
89
Once your configuration changes have been made, restart Gitea to have changes take effect.
0 commit comments