diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-03-04 21:19:11 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-03-04 21:19:11 +0000 |
commit | 925da3fdf83b81014502f5a72191e940dd401f3c (patch) | |
tree | a0aba936d461d2ae041cd507b1d632cee8afdc36 /lib/banzai | |
parent | 3231ea10b7319f6fe50c0ec1407ddaac69089641 (diff) | |
parent | def6446dad808f2ff0f725df7a08f81365719586 (diff) | |
download | gitlab-ce-925da3fdf83b81014502f5a72191e940dd401f3c.tar.gz |
Merge branch 'rs-wiki-pipeline-spec' into 'master'
Add a spec for WikiPipeline
Removes the specs from GollumTagsFilter that were more like integration
tests for the pipeline than unit tests of the filter.
See merge request !3054
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/gollum_tags_filter.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/banzai/filter/gollum_tags_filter.rb b/lib/banzai/filter/gollum_tags_filter.rb index bcf5297e382..f31f921903b 100644 --- a/lib/banzai/filter/gollum_tags_filter.rb +++ b/lib/banzai/filter/gollum_tags_filter.rb @@ -26,6 +26,10 @@ module Banzai # * [[http://example.com/images/logo.png]] # * [[http://example.com/images/logo.png|alt=Logo]] # + # - Insert a Table of Contents list: + # + # * [[_TOC_]] + # # Based on Gollum::Filter::Tags # # Context options: @@ -61,8 +65,6 @@ module Banzai # before this one, it will be converted into `[[<em>TOC</em>]]`, so it # needs special-case handling if toc_tag?(node) - next unless result[:toc].present? - process_toc_tag(node) else content = node.content @@ -85,7 +87,7 @@ module Banzai # Replace an entire `[[<em>TOC</em>]]` node with the result generated by # TableOfContentsFilter def process_toc_tag(node) - node.parent.parent.replace(result[:toc]) + node.parent.parent.replace(result[:toc].presence || '') end # Process a single tag into its final HTML form. |