From 9a5d4d30e9e4b831bc8fc9460c062499ccb87f76 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 12 Feb 2022 11:59:04 +0800 Subject: [PATCH 1/2] Add example to render html files --- .../doc/advanced/external-renderers.en-us.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/content/doc/advanced/external-renderers.en-us.md b/docs/content/doc/advanced/external-renderers.en-us.md index e5de7e8efd7d1..dbec43a4cb931 100644 --- a/docs/content/doc/advanced/external-renderers.en-us.md +++ b/docs/content/doc/advanced/external-renderers.en-us.md @@ -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 = style + +[markup.sanitizer.html.2] +ELEMENT = a +ALLOW_ATTR = style +``` + ### Example: Office DOCX Display Office DOCX files with [`pandoc`](https://pandoc.org/): From a0cfdb14007cc6d37b3e39888b0a7623e8c7017f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 12 Feb 2022 13:27:31 +0800 Subject: [PATCH 2/2] Use class in example --- docs/content/doc/advanced/external-renderers.en-us.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/doc/advanced/external-renderers.en-us.md b/docs/content/doc/advanced/external-renderers.en-us.md index dbec43a4cb931..34329408a1d5b 100644 --- a/docs/content/doc/advanced/external-renderers.en-us.md +++ b/docs/content/doc/advanced/external-renderers.en-us.md @@ -117,11 +117,11 @@ IS_INPUT_FILE = true [markup.sanitizer.html.1] ELEMENT = div -ALLOW_ATTR = style +ALLOW_ATTR = class [markup.sanitizer.html.2] ELEMENT = a -ALLOW_ATTR = style +ALLOW_ATTR = class ``` ### Example: Office DOCX