diff options
Diffstat (limited to 'spec/lib/banzai/filter/ascii_doc_post_processing_filter_spec.rb')
-rw-r--r-- | spec/lib/banzai/filter/ascii_doc_post_processing_filter_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/ascii_doc_post_processing_filter_spec.rb b/spec/lib/banzai/filter/ascii_doc_post_processing_filter_spec.rb new file mode 100644 index 00000000000..33b812ef425 --- /dev/null +++ b/spec/lib/banzai/filter/ascii_doc_post_processing_filter_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe Banzai::Filter::AsciiDocPostProcessingFilter, lib: true 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 |