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/lib
diff options
context:
space:
mode:
authorSuzanne Selhorn <sselhorn@gitlab.com>2021-08-04 16:46:16 +0300
committerCraig Norris <cnorris@gitlab.com>2021-08-04 16:46:16 +0300
commit81aa474b8ccca6cee84177423591c25a17cbf7d1 (patch)
tree530366ce09a704075dfc02208f29dcb25382e1e2 /lib
parent3e20646657e6be706ff54c9702f5755b4bc45c13 (diff)
Add alert for FLAG
Diffstat (limited to 'lib')
-rw-r--r--lib/filters/admonition.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/filters/admonition.rb b/lib/filters/admonition.rb
index e48688ac..b5040bbf 100644
--- a/lib/filters/admonition.rb
+++ b/lib/filters/admonition.rb
@@ -4,12 +4,14 @@ class AdmonitionFilter < Nanoc::Filter
BOOTSTRAP_MAPPING = {
'note' => 'info',
- 'warning' => 'warning'
+ 'warning' => 'warning',
+ 'flag' => 'flag'
}.freeze
GITLAB_SVGS_MAPPING = {
'note' => 'information-o',
- 'warning' => 'warning'
+ 'warning' => 'warning',
+ 'flag' => 'flag'
}.freeze
def run(content, params = {})
@@ -18,7 +20,7 @@ class AdmonitionFilter < Nanoc::Filter
doc = Nokogiri::HTML.fragment(content.dup)
doc.css('p').each do |para|
content = para.inner_html
- match = content.match(/\A(?<type>NOTE|WARNING):\s?(?<content>.*)\Z/m)
+ match = content.match(/\A(?<type>NOTE|WARNING|FLAG):\s?(?<content>.*)\Z/m)
next unless match
new_content = generate(match[:type].downcase, match[:content])