summaryrefslogtreecommitdiff
path: root/lib/banzai/pipeline
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-02-23 18:05:10 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-02-23 18:25:40 -0500
commitbc43ad71ef2c1ab6cf56d94ac93df0bdc0e2b741 (patch)
tree1bc743f62ccd30593e430180dfa48c821f7940a2 /lib/banzai/pipeline
parent9f80118e05e68743d95a83742a1d0a06bba3039c (diff)
downloadgitlab-ce-bc43ad71ef2c1ab6cf56d94ac93df0bdc0e2b741.tar.gz
Replace Gollum `[[_TOC_]]` tag with result of TableOfContentsFilterrs-wiki-toc
Closes #2494
Diffstat (limited to 'lib/banzai/pipeline')
-rw-r--r--lib/banzai/pipeline/wiki_pipeline.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/banzai/pipeline/wiki_pipeline.rb b/lib/banzai/pipeline/wiki_pipeline.rb
index 50b5450e70b..bc2bf111971 100644
--- a/lib/banzai/pipeline/wiki_pipeline.rb
+++ b/lib/banzai/pipeline/wiki_pipeline.rb
@@ -4,7 +4,11 @@ module Banzai
module Pipeline
class WikiPipeline < FullPipeline
def self.filters
- super.insert(1, Filter::GollumTagsFilter)
+ @filters ||= begin
+ filters = super
+ toc = filters.index(Filter::TableOfContentsFilter)
+ filters.insert(toc + 1, Filter::GollumTagsFilter)
+ end
end
end
end