diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-06-25 16:21:13 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-06-25 16:21:13 +0900 |
commit | 6c3eea0db04be446a1daebf629b6ddf9e0f18d18 (patch) | |
tree | 7de3db2d1addf9ea8e018817c1b8de378d33fb9d /spec/lib/banzai | |
parent | 24ba0989878a363c37d86758844a17a99fc7ae0c (diff) | |
parent | 2bac2918b2d6f12d94f739f4b6865b9e9221c642 (diff) | |
download | gitlab-ce-6c3eea0db04be446a1daebf629b6ddf9e0f18d18.tar.gz |
Merge branch 'master' into build-chunks-on-object-storage
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r-- | spec/lib/banzai/filter/blockquote_fence_filter_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/banzai/filter/label_reference_filter_spec.rb | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/spec/lib/banzai/filter/blockquote_fence_filter_spec.rb b/spec/lib/banzai/filter/blockquote_fence_filter_spec.rb index 8224dc5a6b9..b645e49bd43 100644 --- a/spec/lib/banzai/filter/blockquote_fence_filter_spec.rb +++ b/spec/lib/banzai/filter/blockquote_fence_filter_spec.rb @@ -11,4 +11,8 @@ describe Banzai::Filter::BlockquoteFenceFilter do expect(output).to eq(expected) end + + it 'allows trailing whitespace on blockquote fence lines' do + expect(filter(">>> \ntest\n>>> ")).to eq("> test") + end end diff --git a/spec/lib/banzai/filter/label_reference_filter_spec.rb b/spec/lib/banzai/filter/label_reference_filter_spec.rb index b30f3661e70..00257ed7904 100644 --- a/spec/lib/banzai/filter/label_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/label_reference_filter_spec.rb @@ -148,9 +148,11 @@ describe Banzai::Filter::LabelReferenceFilter do expect(doc.text).to eq 'See ?g.fm&' end - it 'links with adjacent text' do - doc = reference_filter("Label (#{reference}).") - expect(doc.to_html).to match(%r(\(<a.+><span.+>\?g\.fm&</span></a>\)\.)) + it 'does not include trailing punctuation', :aggregate_failures do + ['.', ', ok?', '...', '?', '!', ': is that ok?'].each do |trailing_punctuation| + doc = filter("Label #{reference}#{trailing_punctuation}") + expect(doc.to_html).to match(%r(<a.+><span.+>\?g\.fm&</span></a>#{Regexp.escape(trailing_punctuation)})) + end end it 'ignores invalid label names' do |