'<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
it'does not replace plantuml pre tag with img tag if disabled'do
stub_application_setting(plantuml_enabled: false)
input='<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>'
output='<pre><code lang="plantuml">Bob -> Sara : Hello</code></pre>'
doc=filter(input)
context'using ruby-based HTML renderer'do
beforedo
stub_feature_flags(use_cmark_renderer: false)
end
expect(doc.to_s).toeqoutput
it_behaves_like'renders correct markdown'
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>'
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).
ADOC
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>
</div>
HTML
context'with footnotes'do
it'preserves ids and links'do
input=<<~ADOC
This paragraph has a footnote.footnote:[This is the text of the footnote.]
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>
</div>
HTML
[.big]##O##nce upon an infinite loop.
ADOC
output=<<~HTML
<div>
<p>Werewolves are allergic to <mark>cassia cinnamon</mark>.</p>
</div>
<div>
<p>Did the werewolves read the <span class="small">small print</span>?</p>
</div>
<div>
<p>Where did all the <span class="underline small">cores</span> run off to?</p>
</div>
<div>
<p>We need <span class="line-through">ten</span> make that twenty VMs.</p>
</div>
<div>
<p><span class="big">O</span>nce upon an infinite loop.</p>