diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-03 12:08:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-03 12:08:20 +0300 |
commit | a1aeaba23e388ac96d34c135c6c55e414f823487 (patch) | |
tree | 12ac28cdba58353efe18053028d6028a965c6358 /lib/banzai | |
parent | d72fedf168dafcb38bd51b67f86804738000fb48 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/abstract_reference_filter.rb | 4 | ||||
-rw-r--r-- | lib/banzai/filter/autolink_filter.rb | 2 | ||||
-rw-r--r-- | lib/banzai/filter/emoji_filter.rb | 2 | ||||
-rw-r--r-- | lib/banzai/filter/gollum_tags_filter.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/banzai/filter/abstract_reference_filter.rb b/lib/banzai/filter/abstract_reference_filter.rb index b0a2f6f69d5..2448c2c2bb2 100644 --- a/lib/banzai/filter/abstract_reference_filter.rb +++ b/lib/banzai/filter/abstract_reference_filter.rb @@ -265,7 +265,7 @@ module Banzai extras = [] if matches.names.include?("anchor") && matches[:anchor] && matches[:anchor] =~ /\A\#note_(\d+)\z/ - extras << "comment #{$1}" + extras << "comment #{Regexp.last_match(1)}" end extension = matches[:extension] if matches.names.include?("extension") @@ -436,7 +436,7 @@ module Banzai escaped = escape_html_entities(text) escaped.gsub(REFERENCE_PLACEHOLDER_PATTERN) do |match| - placeholder_data[$1.to_i] + placeholder_data[Regexp.last_match(1).to_i] end end end diff --git a/lib/banzai/filter/autolink_filter.rb b/lib/banzai/filter/autolink_filter.rb index 4723bfbf261..0aa1ee8f604 100644 --- a/lib/banzai/filter/autolink_filter.rb +++ b/lib/banzai/filter/autolink_filter.rb @@ -86,7 +86,7 @@ module Banzai # outside the link element. The entity must be marked HTML safe in # order to be output literally rather than escaped. match.gsub!(/((?:&[\w#]+;)+)\z/, '') - dropped = ($1 || '').html_safe + dropped = (Regexp.last_match(1) || '').html_safe # To match the behaviour of Rinku, if the matched link ends with a # closing part of a matched pair of punctuation, we remove that trailing diff --git a/lib/banzai/filter/emoji_filter.rb b/lib/banzai/filter/emoji_filter.rb index fa1690f73ad..b32fe5e8301 100644 --- a/lib/banzai/filter/emoji_filter.rb +++ b/lib/banzai/filter/emoji_filter.rb @@ -33,7 +33,7 @@ module Banzai # Returns a String with :emoji: replaced with gl-emoji unicode. def emoji_name_element_unicode_filter(text) text.gsub(emoji_pattern) do |match| - name = $1 + name = Regexp.last_match(1) Gitlab::Emoji.gl_emoji_tag(name) end end diff --git a/lib/banzai/filter/gollum_tags_filter.rb b/lib/banzai/filter/gollum_tags_filter.rb index 7928272a2cf..e16de13725f 100644 --- a/lib/banzai/filter/gollum_tags_filter.rb +++ b/lib/banzai/filter/gollum_tags_filter.rb @@ -64,7 +64,7 @@ module Banzai next if has_ancestor?(node, IGNORED_ANCESTOR_TAGS) next unless node.content =~ TAGS_PATTERN - html = process_tag($1) + html = process_tag(Regexp.last_match(1)) node.replace(html) if html && html != node.content end |