Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Rules
diff options
context:
space:
mode:
authorCatalin Irimie <cirimie@gitlab.com>2020-10-21 02:38:59 +0300
committerCatalin Irimie <cirimie@gitlab.com>2020-10-21 02:38:59 +0300
commit823b3a6f35d748cc1a46c9bb71a7422d4a26ff1c (patch)
tree140ffd43fcead3d9a74984ae8f9c776f0ca8754f /Rules
parent313bca78a52d1a098163ddafbdba80afcf4c98a4 (diff)
Encode Mermaid HTML to htmlsafe values
There's an inconsistency with some filters, for example admonition and introduced_in, that call Nokogiri::HTML#fragment on the input and write the output, which means code that looks like tags gets treated as actual HTML tags. This breaks mermaid diagrams because those tags are not valid and the Mermaid JS parser trips over them, converting them to the html-encoded values is what was currently happening for ->> strings and it's working, so pre-converting all of them gets rid of the problem.
Diffstat (limited to 'Rules')
-rw-r--r--Rules2
1 files changed, 2 insertions, 0 deletions
diff --git a/Rules b/Rules
index 867a7cca..77998113 100644
--- a/Rules
+++ b/Rules
@@ -82,6 +82,8 @@ compile '/**/*.md' do
toc_levels: 2..5,
with_toc: include_toc
+ filter :convert_mermaid_html
+
filter :colorize_syntax,
default_colorizer: :rouge