From a9940506cfffaf1e502d8cac93745e2f93eec714 Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Thu, 5 Dec 2024 20:41:24 +0800 Subject: [PATCH] Extend rendered-plain-text template to support more languages. (#8780) --- .../{rendered-plain-text.tid => rendered-plain-text/css.tid} | 3 ++- core/ui/ViewTemplate/body/rendered-plain-text/html.tid | 4 ++++ core/wiki/config/ViewTemplateBodyFilters.multids | 1 + core/wiki/tags/ViewTemplateBodyFilter.tid | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) rename core/ui/ViewTemplate/body/{rendered-plain-text.tid => rendered-plain-text/css.tid} (66%) create mode 100644 core/ui/ViewTemplate/body/rendered-plain-text/html.tid diff --git a/core/ui/ViewTemplate/body/rendered-plain-text.tid b/core/ui/ViewTemplate/body/rendered-plain-text/css.tid similarity index 66% rename from core/ui/ViewTemplate/body/rendered-plain-text.tid rename to core/ui/ViewTemplate/body/rendered-plain-text/css.tid index d1dcc0f80..2e78bedcc 100644 --- a/core/ui/ViewTemplate/body/rendered-plain-text.tid +++ b/core/ui/ViewTemplate/body/rendered-plain-text/css.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ViewTemplate/body/rendered-plain-text code-body: yes \whitespace trim +\parameters (language:"css") <$wikify name="text" text={{!!text}} type={{!!type}}> -<$codeblock code=<> language="css"/> +<$codeblock code=<> language=<>/> diff --git a/core/ui/ViewTemplate/body/rendered-plain-text/html.tid b/core/ui/ViewTemplate/body/rendered-plain-text/html.tid new file mode 100644 index 000000000..d0742afcc --- /dev/null +++ b/core/ui/ViewTemplate/body/rendered-plain-text/html.tid @@ -0,0 +1,4 @@ +title: $:/core/ui/ViewTemplate/body/rendered-plain-text/html +code-body: yes + +{{||$:/core/ui/ViewTemplate/body/rendered-plain-text|html}} \ No newline at end of file diff --git a/core/wiki/config/ViewTemplateBodyFilters.multids b/core/wiki/config/ViewTemplateBodyFilters.multids index 90c127a0c..8fdddd775 100644 --- a/core/wiki/config/ViewTemplateBodyFilters.multids +++ b/core/wiki/config/ViewTemplateBodyFilters.multids @@ -3,6 +3,7 @@ tags: $:/tags/ViewTemplateBodyFilter testcase: [tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]] [tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]] :then[[$:/core/ui/TestCaseTemplate]] stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]] +html: [tag[$:/tags/RawMarkupWikified]] [tag[$:/tags/RawMarkupWikified/TopHead]] [tag[$:/tags/RawMarkupWikified/TopBody]] [tag[$:/tags/RawMarkupWikified/BottomBody]] :then[[$:/core/ui/ViewTemplate/body/rendered-plain-text/html]] core-ui-tags: [tag[$:/tags/PageTemplate]] [tag[$:/tags/EditTemplate]] [tag[$:/tags/ViewTemplate]] [tag[$:/tags/KeyboardShortcut]] [tag[$:/tags/ImportPreview]] [tag[$:/tags/EditPreview]] [tag[$:/tags/EditorToolbar]] [tag[$:/EditorTools]] [tag[$:/tags/Actions]] [tag[$:/tags/ToolbarButtonStyle]] :then[[$:/core/ui/ViewTemplate/body/code]] system: [prefix[$:/boot/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/config/]] [prefix[$:/core/config/]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/info/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/temp/]] :and[!is[image]] :then[[$:/core/ui/ViewTemplate/body/code]] code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]] diff --git a/core/wiki/tags/ViewTemplateBodyFilter.tid b/core/wiki/tags/ViewTemplateBodyFilter.tid index c7510cb09..8e219ecf1 100644 --- a/core/wiki/tags/ViewTemplateBodyFilter.tid +++ b/core/wiki/tags/ViewTemplateBodyFilter.tid @@ -1,2 +1,2 @@ title: $:/tags/ViewTemplateBodyFilter -list: $:/config/ViewTemplateBodyFilters/testcase $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/default +list: $:/config/ViewTemplateBodyFilters/testcase $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/html $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/default