Commit 1753efbc authored by Douwe Maan's avatar Douwe Maan

Add spec for more examples of trailing punctuation that should be ignored

parent 96f8ad06
......@@ -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&amp;</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&amp;</span></a>#{Regexp.escape(trailing_punctuation)}))
end
end
it 'ignores invalid label names' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment