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:
authorEvan Read <eread@gitlab.com>2020-11-26 02:35:21 +0300
committerEvan Read <eread@gitlab.com>2020-11-26 02:35:21 +0300
commit8c7c27a5b1c9099a8c95f5be4158cc77755ab9fc (patch)
tree7f07cb6bdc9cee9d3f70ad60c101edd5c2dd9c0a /lib
parent2097c27b786c02f23beff370e7ffbbfa52dd972a (diff)
Fix Rubocop issues in icons code
Diffstat (limited to 'lib')
-rw-r--r--lib/filters/icons.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/filters/icons.rb b/lib/filters/icons.rb
index d695b7a2..7e7df019 100644
--- a/lib/filters/icons.rb
+++ b/lib/filters/icons.rb
@@ -16,15 +16,15 @@ class IconsFilter < Nanoc::Filter
identifier :icons
ICON_PATTERN = /\{\s*([\w-]+)\s*(?:,\s*(\d+))?\s*(?:,\s*([\w-]+))?\s*\}/.freeze
- ICON_HTML_PATTERN = /<strong>#{ICON_PATTERN}<\/strong>/.freeze
+ ICON_HTML_PATTERN = %r{<strong>#{ICON_PATTERN}</strong>}.freeze
ICON_MARKDOWN_PATTERN = /\*\*#{ICON_PATTERN}\*\*/.freeze
def run(content, params = {})
- content.gsub(ICON_HTML_PATTERN) { generate($1, $2, $3) }
+ content.gsub(ICON_HTML_PATTERN) { generate(Regexp.last_match(1), Regexp.last_match(2), Regexp.last_match(3)) }
end
def run_from_markdown(content)
- content.gsub(ICON_MARKDOWN_PATTERN) { generate($1, $2, $3) }
+ content.gsub(ICON_MARKDOWN_PATTERN) { generate(Regexp.last_match(1), Regexp.last_match(2), Regexp.last_match(3)) }
end
def generate(icon, size, css_class)