diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-23 18:05:10 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-23 18:25:40 -0500 |
commit | bc43ad71ef2c1ab6cf56d94ac93df0bdc0e2b741 (patch) | |
tree | 1bc743f62ccd30593e430180dfa48c821f7940a2 /lib/banzai/pipeline | |
parent | 9f80118e05e68743d95a83742a1d0a06bba3039c (diff) | |
download | gitlab-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.rb | 6 |
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 |