diff options
Diffstat (limited to 'spec/lib/banzai/filter/plantuml_filter_spec.rb')
-rw-r--r-- | spec/lib/banzai/filter/plantuml_filter_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/plantuml_filter_spec.rb b/spec/lib/banzai/filter/plantuml_filter_spec.rb index dcfeb2ce3ba..4373af90cde 100644 --- a/spec/lib/banzai/filter/plantuml_filter_spec.rb +++ b/spec/lib/banzai/filter/plantuml_filter_spec.rb @@ -15,6 +15,16 @@ RSpec.describe Banzai::Filter::PlantumlFilter do expect(doc.to_s).to eq output end + it 'allows the lang attribute on the code tag to support RST files processed by gitlab-markup gem' do + stub_application_setting(plantuml_enabled: true, plantuml_url: "http://localhost:8080") + + input = '<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>' + output = '<img class="plantuml" src="http://localhost:8080/png/U9npoazIqBLJ24uiIbImKl18pSd91m0rkGMq" data-diagram="plantuml" data-diagram-src="data:text/plain;base64,Qm9iIC0+IFNhcmEgOiBIZWxsbw==">' + doc = filter(input) + + expect(doc.to_s).to eq output + end + it 'does not replace plantuml pre tag with img tag if disabled' do stub_application_setting(plantuml_enabled: false) |