summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-03-04 21:19:11 +0000
committerDouwe Maan <douwe@gitlab.com>2016-03-04 21:19:11 +0000
commit925da3fdf83b81014502f5a72191e940dd401f3c (patch)
treea0aba936d461d2ae041cd507b1d632cee8afdc36 /lib/banzai
parent3231ea10b7319f6fe50c0ec1407ddaac69089641 (diff)
parentdef6446dad808f2ff0f725df7a08f81365719586 (diff)
downloadgitlab-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.rb8
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.