summaryrefslogtreecommitdiff
path: root/lib/banzai/filter/gollum_tags_filter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/filter/gollum_tags_filter.rb')
-rw-r--r--lib/banzai/filter/gollum_tags_filter.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/banzai/filter/gollum_tags_filter.rb b/lib/banzai/filter/gollum_tags_filter.rb
index f2e9a5a1116..4bc82ecb4d6 100644
--- a/lib/banzai/filter/gollum_tags_filter.rb
+++ b/lib/banzai/filter/gollum_tags_filter.rb
@@ -58,6 +58,9 @@ module Banzai
def call
doc.search(".//text()").each do |node|
+ # Do not perform linking inside <code> blocks
+ next unless node.ancestors('code').empty?
+
# A Gollum ToC tag is `[[_TOC_]]`, but due to MarkdownFilter running
# before this one, it will be converted into `[[<em>TOC</em>]]`, so it
# needs special-case handling