'<pre lang="plantuml"><code>Bob -> Sara : Hello</code></pre>'
else
'<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>'
end
output='<div class="listingblock"><div class="content"><pre class="plantuml plantuml-error"> Error: cannot connect to PlantUML server at "invalid"</pre></div></div>'
doc=filter(input)
expect(doc.to_s).toeqoutput
end
end
end
it'does not replace plantuml pre tag with img tag if disabled'do
context'using ruby-based HTML renderer'do
stub_application_setting(plantuml_enabled: false)
beforedo
input='<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>'
stub_feature_flags(use_cmark_renderer: false)
output='<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>'
end
doc=filter(input)
expect(doc.to_s).toeqoutput
it_behaves_like'renders correct markdown'
end
end
it'does not replace plantuml pre tag with img tag if url is invalid'do
input='<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>'
stub_feature_flags(use_cmark_renderer: true)
output='<div class="listingblock"><div class="content"><pre class="plantuml plantuml-error"> Error: cannot connect to PlantUML server at "invalid"</pre></div></div>'