summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-21 18:47:39 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:31:57 -0600
commitbaafd8de26507ebd76177b5c65b5da921445ddc9 (patch)
treee42fa7a49b6615dbf4e2c8a65077de399bec01b8 /lib/banzai
parentd78513cb6ccfe10976cc433e2b421c30d06d19be (diff)
downloadgitlab-ce-baafd8de26507ebd76177b5c65b5da921445ddc9.tar.gz
Enable Style/BarePercentLiterals
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/autolink_filter.rb2
-rw-r--r--lib/banzai/filter/reference_filter.rb4
-rw-r--r--lib/banzai/filter/table_of_contents_filter.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/banzai/filter/autolink_filter.rb b/lib/banzai/filter/autolink_filter.rb
index b8d2673c1a6..e84b7c2c0c3 100644
--- a/lib/banzai/filter/autolink_filter.rb
+++ b/lib/banzai/filter/autolink_filter.rb
@@ -32,7 +32,7 @@ module Banzai
IGNORE_PARENTS = %w(a code kbd pre script style).to_set
# The XPath query to use for finding text nodes to parse.
- TEXT_QUERY = %Q(descendant-or-self::text()[
+ TEXT_QUERY = %(descendant-or-self::text()[
not(#{IGNORE_PARENTS.map { |p| "ancestor::#{p}" }.join(' or ')})
and contains(., '://')
and not(starts-with(., 'http'))
diff --git a/lib/banzai/filter/reference_filter.rb b/lib/banzai/filter/reference_filter.rb
index 6640168bfa2..6281fa7e401 100644
--- a/lib/banzai/filter/reference_filter.rb
+++ b/lib/banzai/filter/reference_filter.rb
@@ -32,7 +32,7 @@ module Banzai
attributes[:reference_type] ||= self.class.reference_type
attributes.delete(:original) if context[:no_original_data]
attributes.map do |key, value|
- %Q(data-#{key.to_s.dasherize}="#{escape_once(value)}")
+ %(data-#{key.to_s.dasherize}="#{escape_once(value)}")
end.join(' ')
end
@@ -76,7 +76,7 @@ module Banzai
def each_node
return to_enum(__method__) unless block_given?
- query = %Q{descendant-or-self::text()[not(#{ignore_ancestor_query})]
+ query = %{descendant-or-self::text()[not(#{ignore_ancestor_query})]
| descendant-or-self::a[
not(contains(concat(" ", @class, " "), " gfm ")) and not(@href = "")
]}
diff --git a/lib/banzai/filter/table_of_contents_filter.rb b/lib/banzai/filter/table_of_contents_filter.rb
index 8e7084f2543..d460110b974 100644
--- a/lib/banzai/filter/table_of_contents_filter.rb
+++ b/lib/banzai/filter/table_of_contents_filter.rb
@@ -43,7 +43,7 @@ module Banzai
end
end
- result[:toc] = %Q{<ul class="section-nav">\n#{result[:toc]}</ul>} unless result[:toc].empty?
+ result[:toc] = %{<ul class="section-nav">\n#{result[:toc]}</ul>} unless result[:toc].empty?
doc
end
@@ -51,11 +51,11 @@ module Banzai
private
def anchor_tag(id, href)
- %Q{<a id="#{id}" class="anchor" href="##{href}" aria-hidden="true"></a>}
+ %{<a id="#{id}" class="anchor" href="##{href}" aria-hidden="true"></a>}
end
def push_toc(href, text)
- result[:toc] << %Q{<li><a href="##{href}">#{text}</a></li>\n}
+ result[:toc] << %{<li><a href="##{href}">#{text}</a></li>\n}
end
end
end