diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/autolink_filter.rb | 2 | ||||
-rw-r--r-- | lib/banzai/filter/reference_filter.rb | 4 | ||||
-rw-r--r-- | lib/banzai/filter/table_of_contents_filter.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/database/median.rb | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/banzai/filter/autolink_filter.rb b/lib/banzai/filter/autolink_filter.rb index e84b7c2c0c3..b8d2673c1a6 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 = %(descendant-or-self::text()[ + TEXT_QUERY = %Q(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 6281fa7e401..6640168bfa2 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| - %(data-#{key.to_s.dasherize}="#{escape_once(value)}") + %Q(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 = %{descendant-or-self::text()[not(#{ignore_ancestor_query})] + query = %Q{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 d460110b974..8e7084f2543 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] = %{<ul class="section-nav">\n#{result[:toc]}</ul>} unless result[:toc].empty? + result[:toc] = %Q{<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) - %{<a id="#{id}" class="anchor" href="##{href}" aria-hidden="true"></a>} + %Q{<a id="#{id}" class="anchor" href="##{href}" aria-hidden="true"></a>} end def push_toc(href, text) - result[:toc] << %{<li><a href="##{href}">#{text}</a></li>\n} + result[:toc] << %Q{<li><a href="##{href}">#{text}</a></li>\n} end end end diff --git a/lib/gitlab/database/median.rb b/lib/gitlab/database/median.rb index e265d22a989..059054ac9ff 100644 --- a/lib/gitlab/database/median.rb +++ b/lib/gitlab/database/median.rb @@ -100,13 +100,13 @@ module Gitlab end def extract_epoch(arel_attribute) - Arel.sql(%{EXTRACT(EPOCH FROM "#{arel_attribute.relation.name}"."#{arel_attribute.name}")}) + Arel.sql(%Q{EXTRACT(EPOCH FROM "#{arel_attribute.relation.name}"."#{arel_attribute.name}")}) end def extract_diff_epoch(diff) return diff unless Gitlab::Database.postgresql? - Arel.sql(%{EXTRACT(EPOCH FROM (#{diff.to_sql}))}) + Arel.sql(%Q{EXTRACT(EPOCH FROM (#{diff.to_sql}))}) end # Need to cast '0' to an INTERVAL before we can check if the interval is positive |