'<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>'
Learn how to xref:cross-references[use cross references].
[[cross-references]]A link to another location within an AsciiDoc document or between AsciiDoc documents is called a cross reference (also referred to as an xref).
context'with footnotes'do
ADOC
it'preserves ids and links'do
input=<<~ADOC
output=<<~HTML
This paragraph has a footnote.footnote:[This is the text of the footnote.]
<div>
ADOC
<p>Learn how to <a href="#cross-references">use cross references</a>.</p>
</div>
<div>
<p><a id="user-content-cross-references"></a>A link to another location within an AsciiDoc document or between AsciiDoc documents is called a cross reference (also referred to as an xref).</p>
Did the werewolves read the [.small]#small print#?
Where did all the [.underline.small]#cores# run off to?
context'with xrefs'do
it'preserves ids'do
input=<<~ADOC
Learn how to xref:cross-references[use cross references].
[[cross-references]]A link to another location within an AsciiDoc document or between AsciiDoc documents is called a cross reference (also referred to as an xref).
ADOC
We need [.line-through]#ten# make that twenty VMs.
output=<<~HTML
<div>
<p>Learn how to <a href="#cross-references">use cross references</a>.</p>
</div>
<div>
<p><a id="user-content-cross-references"></a>A link to another location within an AsciiDoc document or between AsciiDoc documents is called a cross reference (also referred to as an xref).</p>