2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2016-08-24 12:49:21 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Banzai::Filter::BlockquoteFenceFilter do
|
2016-08-24 12:49:21 +05:30
|
|
|
include FilterSpecHelper
|
|
|
|
|
|
|
|
it 'converts blockquote fences to blockquote lines' do
|
|
|
|
content = File.read(Rails.root.join('spec/fixtures/blockquote_fence_before.md'))
|
|
|
|
expected = File.read(Rails.root.join('spec/fixtures/blockquote_fence_after.md'))
|
|
|
|
|
|
|
|
output = filter(content)
|
|
|
|
|
|
|
|
expect(output).to eq(expected)
|
|
|
|
end
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
it 'allows trailing whitespace on blockquote fence lines' do
|
2019-07-07 11:18:12 +05:30
|
|
|
expect(filter(">>> \ntest\n>>> ")).to eq("\n> test\n")
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|