summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/filter/ascii_doc_post_processing_filter_spec.rb
blob: 34f1657b6d3dde288391f8a47882c90729b4cbc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'spec_helper'

describe Banzai::Filter::AsciiDocPostProcessingFilter do
  include FilterSpecHelper

  it "adds class for elements with data-math-style" do
    result = filter('<pre data-math-style="inline">some code</pre><div data-math>and</div>').to_html
    expect(result).to eq('<pre data-math-style="inline" class="code math js-render-math">some code</pre><div data-math>and</div>')
  end

  it "keeps content when no data-math-style found" do
    result = filter('<pre>some code</pre><div data-math>and</div>').to_html
    expect(result).to eq('<pre>some code</pre><div data-math>and</div>')
  end
end