Skip to content

Commit

Permalink
Add example to render html files (go-gitea#18736)
Browse files Browse the repository at this point in the history
* Add example to render html files

* Use class in example

Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
lunny and zeripath authored Feb 14, 2022
1 parent ecc3954 commit 5348e19
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/content/doc/advanced/external-renderers.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,27 @@ Once your configuration changes have been made, restart Gitea to have changes ta
**Note**: Prior to Gitea 1.12 there was a single `markup.sanitiser` section with keys that were redefined for multiple rules, however,
there were significant problems with this method of configuration necessitating configuration through multiple sections.

### Example: HTML

Render HTML files directly:

```ini
[markup.html]
ENABLED = true
FILE_EXTENSIONS = .html,.htm
RENDER_COMMAND = cat
; Input is not a standard input but a file
IS_INPUT_FILE = true

[markup.sanitizer.html.1]
ELEMENT = div
ALLOW_ATTR = class

[markup.sanitizer.html.2]
ELEMENT = a
ALLOW_ATTR = class
```

### Example: Office DOCX

Display Office DOCX files with [`pandoc`](https://pandoc.org/):
Expand Down

0 comments on commit 5348e19

Please sign in to comment.