Files

9167 lines
146 KiB
Rust
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! `CommonMark` test suite.
// > 👉 **Important**: this module is generated by `generate/src/main.rs`.
// > It is generate from the latest CommonMark website.
use markdown::{message, to_html_with_options, CompileOptions, Options};
use pretty_assertions::assert_eq;
#[rustfmt::skip]
#[test]
fn commonmark() -> Result<(), message::Message> {
let danger = Options {
compile: CompileOptions {
allow_dangerous_html: true,
allow_dangerous_protocol: true,
..CompileOptions::default()
},
..Options::default()
};
assert_eq!(
to_html_with_options(
r###" foo baz bim
"###,
&danger
)?,
r###"<pre><code>foo baz bim
</code></pre>
"###,
r###"Tabs (1)"###
);
assert_eq!(
to_html_with_options(
r###" foo baz bim
"###,
&danger
)?,
r###"<pre><code>foo baz bim
</code></pre>
"###,
r###"Tabs (2)"###
);
assert_eq!(
to_html_with_options(
r###" a a
ὐ a
"###,
&danger
)?,
r###"<pre><code>a a
ὐ a
</code></pre>
"###,
r###"Tabs (3)"###
);
assert_eq!(
to_html_with_options(
r###" - foo
bar
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<p>bar</p>
</li>
</ul>
"###,
r###"Tabs (4)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
bar
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<pre><code> bar
</code></pre>
</li>
</ul>
"###,
r###"Tabs (5)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
"###,
&danger
)?,
r###"<blockquote>
<pre><code> foo
</code></pre>
</blockquote>
"###,
r###"Tabs (6)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
"###,
&danger
)?,
r###"<ul>
<li>
<pre><code> foo
</code></pre>
</li>
</ul>
"###,
r###"Tabs (7)"###
);
assert_eq!(
to_html_with_options(
r###" foo
bar
"###,
&danger
)?,
r###"<pre><code>foo
bar
</code></pre>
"###,
r###"Tabs (8)"###
);
assert_eq!(
to_html_with_options(
r###" - foo
- bar
- baz
"###,
&danger
)?,
r###"<ul>
<li>foo
<ul>
<li>bar
<ul>
<li>baz</li>
</ul>
</li>
</ul>
</li>
</ul>
"###,
r###"Tabs (9)"###
);
assert_eq!(
to_html_with_options(
r###"# Foo
"###,
&danger
)?,
r###"<h1>Foo</h1>
"###,
r###"Tabs (10)"###
);
assert_eq!(
to_html_with_options(
r###"* * *
"###,
&danger
)?,
r###"<hr />
"###,
r###"Tabs (11)"###
);
assert_eq!(
to_html_with_options(
r###"\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~
"###,
&danger
)?,
r###"<p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</p>
"###,
r###"Backslash escapes (12)"###
);
assert_eq!(
to_html_with_options(
r###"\ \A\a\ \3\φ\«
"###,
&danger
)?,
r###"<p>\ \A\a\ \3\φ\«</p>
"###,
r###"Backslash escapes (13)"###
);
assert_eq!(
to_html_with_options(
r###"\*not emphasized*
\<br/> not a tag
\[not a link](/foo)
\`not code`
1\. not a list
\* not a list
\# not a heading
\[foo]: /url "not a reference"
\&ouml; not a character entity
"###,
&danger
)?,
r###"<p>*not emphasized*
&lt;br/&gt; not a tag
[not a link](/foo)
`not code`
1. not a list
* not a list
# not a heading
[foo]: /url &quot;not a reference&quot;
&amp;ouml; not a character entity</p>
"###,
r###"Backslash escapes (14)"###
);
assert_eq!(
to_html_with_options(
r###"\\*emphasis*
"###,
&danger
)?,
r###"<p>\<em>emphasis</em></p>
"###,
r###"Backslash escapes (15)"###
);
assert_eq!(
to_html_with_options(
r###"foo\
bar
"###,
&danger
)?,
r###"<p>foo<br />
bar</p>
"###,
r###"Backslash escapes (16)"###
);
assert_eq!(
to_html_with_options(
r###"`` \[\` ``
"###,
&danger
)?,
r###"<p><code>\[\`</code></p>
"###,
r###"Backslash escapes (17)"###
);
assert_eq!(
to_html_with_options(
r###" \[\]
"###,
&danger
)?,
r###"<pre><code>\[\]
</code></pre>
"###,
r###"Backslash escapes (18)"###
);
assert_eq!(
to_html_with_options(
r###"~~~
\[\]
~~~
"###,
&danger
)?,
r###"<pre><code>\[\]
</code></pre>
"###,
r###"Backslash escapes (19)"###
);
assert_eq!(
to_html_with_options(
r###"<https://example.com?find=\*>
"###,
&danger
)?,
r###"<p><a href="https://example.com?find=%5C*">https://example.com?find=\*</a></p>
"###,
r###"Backslash escapes (20)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="/bar\/)">
"###,
&danger
)?,
r###"<a href="/bar\/)">
"###,
r###"Backslash escapes (21)"###
);
assert_eq!(
to_html_with_options(
r###"[foo](/bar\* "ti\*tle")
"###,
&danger
)?,
r###"<p><a href="/bar*" title="ti*tle">foo</a></p>
"###,
r###"Backslash escapes (22)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[foo]: /bar\* "ti\*tle"
"###,
&danger
)?,
r###"<p><a href="/bar*" title="ti*tle">foo</a></p>
"###,
r###"Backslash escapes (23)"###
);
assert_eq!(
to_html_with_options(
r###"``` foo\+bar
foo
```
"###,
&danger
)?,
r###"<pre><code class="language-foo+bar">foo
</code></pre>
"###,
r###"Backslash escapes (24)"###
);
assert_eq!(
to_html_with_options(
r###"&nbsp; &amp; &copy; &AElig; &Dcaron;
&frac34; &HilbertSpace; &DifferentialD;
&ClockwiseContourIntegral; &ngE;
"###,
&danger
)?,
r###"<p>  &amp; © Æ Ď
¾
∲ ≧̸</p>
"###,
r###"Entity and numeric character references (25)"###
);
assert_eq!(
to_html_with_options(
r###"&#35; &#1234; &#992; &#0;
"###,
&danger
)?,
r###"<p># Ӓ Ϡ </p>
"###,
r###"Entity and numeric character references (26)"###
);
assert_eq!(
to_html_with_options(
r###"&#X22; &#XD06; &#xcab;
"###,
&danger
)?,
r###"<p>&quot; ആ ಫ</p>
"###,
r###"Entity and numeric character references (27)"###
);
assert_eq!(
to_html_with_options(
r###"&nbsp &x; &#; &#x;
&#87654321;
&#abcdef0;
&ThisIsNotDefined; &hi?;
"###,
&danger
)?,
r###"<p>&amp;nbsp &amp;x; &amp;#; &amp;#x;
&amp;#87654321;
&amp;#abcdef0;
&amp;ThisIsNotDefined; &amp;hi?;</p>
"###,
r###"Entity and numeric character references (28)"###
);
assert_eq!(
to_html_with_options(
r###"&copy
"###,
&danger
)?,
r###"<p>&amp;copy</p>
"###,
r###"Entity and numeric character references (29)"###
);
assert_eq!(
to_html_with_options(
r###"&MadeUpEntity;
"###,
&danger
)?,
r###"<p>&amp;MadeUpEntity;</p>
"###,
r###"Entity and numeric character references (30)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="&ouml;&ouml;.html">
"###,
&danger
)?,
r###"<a href="&ouml;&ouml;.html">
"###,
r###"Entity and numeric character references (31)"###
);
assert_eq!(
to_html_with_options(
r###"[foo](/f&ouml;&ouml; "f&ouml;&ouml;")
"###,
&danger
)?,
r###"<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
"###,
r###"Entity and numeric character references (32)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"
"###,
&danger
)?,
r###"<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
"###,
r###"Entity and numeric character references (33)"###
);
assert_eq!(
to_html_with_options(
r###"``` f&ouml;&ouml;
foo
```
"###,
&danger
)?,
r###"<pre><code class="language-föö">foo
</code></pre>
"###,
r###"Entity and numeric character references (34)"###
);
assert_eq!(
to_html_with_options(
r###"`f&ouml;&ouml;`
"###,
&danger
)?,
r###"<p><code>f&amp;ouml;&amp;ouml;</code></p>
"###,
r###"Entity and numeric character references (35)"###
);
assert_eq!(
to_html_with_options(
r###" f&ouml;f&ouml;
"###,
&danger
)?,
r###"<pre><code>f&amp;ouml;f&amp;ouml;
</code></pre>
"###,
r###"Entity and numeric character references (36)"###
);
assert_eq!(
to_html_with_options(
r###"&#42;foo&#42;
*foo*
"###,
&danger
)?,
r###"<p>*foo*
<em>foo</em></p>
"###,
r###"Entity and numeric character references (37)"###
);
assert_eq!(
to_html_with_options(
r###"&#42; foo
* foo
"###,
&danger
)?,
r###"<p>* foo</p>
<ul>
<li>foo</li>
</ul>
"###,
r###"Entity and numeric character references (38)"###
);
assert_eq!(
to_html_with_options(
r###"foo&#10;&#10;bar
"###,
&danger
)?,
r###"<p>foo
bar</p>
"###,
r###"Entity and numeric character references (39)"###
);
assert_eq!(
to_html_with_options(
r###"&#9;foo
"###,
&danger
)?,
r###"<p> foo</p>
"###,
r###"Entity and numeric character references (40)"###
);
assert_eq!(
to_html_with_options(
r###"[a](url &quot;tit&quot;)
"###,
&danger
)?,
r###"<p>[a](url &quot;tit&quot;)</p>
"###,
r###"Entity and numeric character references (41)"###
);
assert_eq!(
to_html_with_options(
r###"- `one
- two`
"###,
&danger
)?,
r###"<ul>
<li>`one</li>
<li>two`</li>
</ul>
"###,
r###"Precedence (42)"###
);
assert_eq!(
to_html_with_options(
r###"***
---
___
"###,
&danger
)?,
r###"<hr />
<hr />
<hr />
"###,
r###"Thematic breaks (43)"###
);
assert_eq!(
to_html_with_options(
r###"+++
"###,
&danger
)?,
r###"<p>+++</p>
"###,
r###"Thematic breaks (44)"###
);
assert_eq!(
to_html_with_options(
r###"===
"###,
&danger
)?,
r###"<p>===</p>
"###,
r###"Thematic breaks (45)"###
);
assert_eq!(
to_html_with_options(
r###"--
**
__
"###,
&danger
)?,
r###"<p>--
**
__</p>
"###,
r###"Thematic breaks (46)"###
);
assert_eq!(
to_html_with_options(
r###" ***
***
***
"###,
&danger
)?,
r###"<hr />
<hr />
<hr />
"###,
r###"Thematic breaks (47)"###
);
assert_eq!(
to_html_with_options(
r###" ***
"###,
&danger
)?,
r###"<pre><code>***
</code></pre>
"###,
r###"Thematic breaks (48)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
***
"###,
&danger
)?,
r###"<p>Foo
***</p>
"###,
r###"Thematic breaks (49)"###
);
assert_eq!(
to_html_with_options(
r###"_____________________________________
"###,
&danger
)?,
r###"<hr />
"###,
r###"Thematic breaks (50)"###
);
assert_eq!(
to_html_with_options(
r###" - - -
"###,
&danger
)?,
r###"<hr />
"###,
r###"Thematic breaks (51)"###
);
assert_eq!(
to_html_with_options(
r###" ** * ** * ** * **
"###,
&danger
)?,
r###"<hr />
"###,
r###"Thematic breaks (52)"###
);
assert_eq!(
to_html_with_options(
r###"- - - -
"###,
&danger
)?,
r###"<hr />
"###,
r###"Thematic breaks (53)"###
);
assert_eq!(
to_html_with_options(
r###"- - - -
"###,
&danger
)?,
r###"<hr />
"###,
r###"Thematic breaks (54)"###
);
assert_eq!(
to_html_with_options(
r###"_ _ _ _ a
a------
---a---
"###,
&danger
)?,
r###"<p>_ _ _ _ a</p>
<p>a------</p>
<p>---a---</p>
"###,
r###"Thematic breaks (55)"###
);
assert_eq!(
to_html_with_options(
r###" *-*
"###,
&danger
)?,
r###"<p><em>-</em></p>
"###,
r###"Thematic breaks (56)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
***
- bar
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
</ul>
<hr />
<ul>
<li>bar</li>
</ul>
"###,
r###"Thematic breaks (57)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
***
bar
"###,
&danger
)?,
r###"<p>Foo</p>
<hr />
<p>bar</p>
"###,
r###"Thematic breaks (58)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
---
bar
"###,
&danger
)?,
r###"<h2>Foo</h2>
<p>bar</p>
"###,
r###"Thematic breaks (59)"###
);
assert_eq!(
to_html_with_options(
r###"* Foo
* * *
* Bar
"###,
&danger
)?,
r###"<ul>
<li>Foo</li>
</ul>
<hr />
<ul>
<li>Bar</li>
</ul>
"###,
r###"Thematic breaks (60)"###
);
assert_eq!(
to_html_with_options(
r###"- Foo
- * * *
"###,
&danger
)?,
r###"<ul>
<li>Foo</li>
<li>
<hr />
</li>
</ul>
"###,
r###"Thematic breaks (61)"###
);
assert_eq!(
to_html_with_options(
r###"# foo
## foo
### foo
#### foo
##### foo
###### foo
"###,
&danger
)?,
r###"<h1>foo</h1>
<h2>foo</h2>
<h3>foo</h3>
<h4>foo</h4>
<h5>foo</h5>
<h6>foo</h6>
"###,
r###"ATX headings (62)"###
);
assert_eq!(
to_html_with_options(
r###"####### foo
"###,
&danger
)?,
r###"<p>####### foo</p>
"###,
r###"ATX headings (63)"###
);
assert_eq!(
to_html_with_options(
r###"#5 bolt
#hashtag
"###,
&danger
)?,
r###"<p>#5 bolt</p>
<p>#hashtag</p>
"###,
r###"ATX headings (64)"###
);
assert_eq!(
to_html_with_options(
r###"\## foo
"###,
&danger
)?,
r###"<p>## foo</p>
"###,
r###"ATX headings (65)"###
);
assert_eq!(
to_html_with_options(
r###"# foo *bar* \*baz\*
"###,
&danger
)?,
r###"<h1>foo <em>bar</em> *baz*</h1>
"###,
r###"ATX headings (66)"###
);
assert_eq!(
to_html_with_options(
r###"# foo
"###,
&danger
)?,
r###"<h1>foo</h1>
"###,
r###"ATX headings (67)"###
);
assert_eq!(
to_html_with_options(
r###" ### foo
## foo
# foo
"###,
&danger
)?,
r###"<h3>foo</h3>
<h2>foo</h2>
<h1>foo</h1>
"###,
r###"ATX headings (68)"###
);
assert_eq!(
to_html_with_options(
r###" # foo
"###,
&danger
)?,
r###"<pre><code># foo
</code></pre>
"###,
r###"ATX headings (69)"###
);
assert_eq!(
to_html_with_options(
r###"foo
# bar
"###,
&danger
)?,
r###"<p>foo
# bar</p>
"###,
r###"ATX headings (70)"###
);
assert_eq!(
to_html_with_options(
r###"## foo ##
### bar ###
"###,
&danger
)?,
r###"<h2>foo</h2>
<h3>bar</h3>
"###,
r###"ATX headings (71)"###
);
assert_eq!(
to_html_with_options(
r###"# foo ##################################
##### foo ##
"###,
&danger
)?,
r###"<h1>foo</h1>
<h5>foo</h5>
"###,
r###"ATX headings (72)"###
);
assert_eq!(
to_html_with_options(
r###"### foo ###
"###,
&danger
)?,
r###"<h3>foo</h3>
"###,
r###"ATX headings (73)"###
);
assert_eq!(
to_html_with_options(
r###"### foo ### b
"###,
&danger
)?,
r###"<h3>foo ### b</h3>
"###,
r###"ATX headings (74)"###
);
assert_eq!(
to_html_with_options(
r###"# foo#
"###,
&danger
)?,
r###"<h1>foo#</h1>
"###,
r###"ATX headings (75)"###
);
assert_eq!(
to_html_with_options(
r###"### foo \###
## foo #\##
# foo \#
"###,
&danger
)?,
r###"<h3>foo ###</h3>
<h2>foo ###</h2>
<h1>foo #</h1>
"###,
r###"ATX headings (76)"###
);
assert_eq!(
to_html_with_options(
r###"****
## foo
****
"###,
&danger
)?,
r###"<hr />
<h2>foo</h2>
<hr />
"###,
r###"ATX headings (77)"###
);
assert_eq!(
to_html_with_options(
r###"Foo bar
# baz
Bar foo
"###,
&danger
)?,
r###"<p>Foo bar</p>
<h1>baz</h1>
<p>Bar foo</p>
"###,
r###"ATX headings (78)"###
);
assert_eq!(
to_html_with_options(
r###"##
#
### ###
"###,
&danger
)?,
r###"<h2></h2>
<h1></h1>
<h3></h3>
"###,
r###"ATX headings (79)"###
);
assert_eq!(
to_html_with_options(
r###"Foo *bar*
=========
Foo *bar*
---------
"###,
&danger
)?,
r###"<h1>Foo <em>bar</em></h1>
<h2>Foo <em>bar</em></h2>
"###,
r###"Setext headings (80)"###
);
assert_eq!(
to_html_with_options(
r###"Foo *bar
baz*
====
"###,
&danger
)?,
r###"<h1>Foo <em>bar
baz</em></h1>
"###,
r###"Setext headings (81)"###
);
assert_eq!(
to_html_with_options(
r###" Foo *bar
baz*
====
"###,
&danger
)?,
r###"<h1>Foo <em>bar
baz</em></h1>
"###,
r###"Setext headings (82)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
-------------------------
Foo
=
"###,
&danger
)?,
r###"<h2>Foo</h2>
<h1>Foo</h1>
"###,
r###"Setext headings (83)"###
);
assert_eq!(
to_html_with_options(
r###" Foo
---
Foo
-----
Foo
===
"###,
&danger
)?,
r###"<h2>Foo</h2>
<h2>Foo</h2>
<h1>Foo</h1>
"###,
r###"Setext headings (84)"###
);
assert_eq!(
to_html_with_options(
r###" Foo
---
Foo
---
"###,
&danger
)?,
r###"<pre><code>Foo
---
Foo
</code></pre>
<hr />
"###,
r###"Setext headings (85)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
----
"###,
&danger
)?,
r###"<h2>Foo</h2>
"###,
r###"Setext headings (86)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
---
"###,
&danger
)?,
r###"<p>Foo
---</p>
"###,
r###"Setext headings (87)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
= =
Foo
--- -
"###,
&danger
)?,
r###"<p>Foo
= =</p>
<p>Foo</p>
<hr />
"###,
r###"Setext headings (88)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
-----
"###,
&danger
)?,
r###"<h2>Foo</h2>
"###,
r###"Setext headings (89)"###
);
assert_eq!(
to_html_with_options(
r###"Foo\
----
"###,
&danger
)?,
r###"<h2>Foo\</h2>
"###,
r###"Setext headings (90)"###
);
assert_eq!(
to_html_with_options(
r###"`Foo
----
`
<a title="a lot
---
of dashes"/>
"###,
&danger
)?,
r###"<h2>`Foo</h2>
<p>`</p>
<h2>&lt;a title=&quot;a lot</h2>
<p>of dashes&quot;/&gt;</p>
"###,
r###"Setext headings (91)"###
);
assert_eq!(
to_html_with_options(
r###"> Foo
---
"###,
&danger
)?,
r###"<blockquote>
<p>Foo</p>
</blockquote>
<hr />
"###,
r###"Setext headings (92)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
bar
===
"###,
&danger
)?,
r###"<blockquote>
<p>foo
bar
===</p>
</blockquote>
"###,
r###"Setext headings (93)"###
);
assert_eq!(
to_html_with_options(
r###"- Foo
---
"###,
&danger
)?,
r###"<ul>
<li>Foo</li>
</ul>
<hr />
"###,
r###"Setext headings (94)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
Bar
---
"###,
&danger
)?,
r###"<h2>Foo
Bar</h2>
"###,
r###"Setext headings (95)"###
);
assert_eq!(
to_html_with_options(
r###"---
Foo
---
Bar
---
Baz
"###,
&danger
)?,
r###"<hr />
<h2>Foo</h2>
<h2>Bar</h2>
<p>Baz</p>
"###,
r###"Setext headings (96)"###
);
assert_eq!(
to_html_with_options(
r###"
====
"###,
&danger
)?,
r###"<p>====</p>
"###,
r###"Setext headings (97)"###
);
assert_eq!(
to_html_with_options(
r###"---
---
"###,
&danger
)?,
r###"<hr />
<hr />
"###,
r###"Setext headings (98)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
-----
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
</ul>
<hr />
"###,
r###"Setext headings (99)"###
);
assert_eq!(
to_html_with_options(
r###" foo
---
"###,
&danger
)?,
r###"<pre><code>foo
</code></pre>
<hr />
"###,
r###"Setext headings (100)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
-----
"###,
&danger
)?,
r###"<blockquote>
<p>foo</p>
</blockquote>
<hr />
"###,
r###"Setext headings (101)"###
);
assert_eq!(
to_html_with_options(
r###"\> foo
------
"###,
&danger
)?,
r###"<h2>&gt; foo</h2>
"###,
r###"Setext headings (102)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
bar
---
baz
"###,
&danger
)?,
r###"<p>Foo</p>
<h2>bar</h2>
<p>baz</p>
"###,
r###"Setext headings (103)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
bar
---
baz
"###,
&danger
)?,
r###"<p>Foo
bar</p>
<hr />
<p>baz</p>
"###,
r###"Setext headings (104)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
bar
* * *
baz
"###,
&danger
)?,
r###"<p>Foo
bar</p>
<hr />
<p>baz</p>
"###,
r###"Setext headings (105)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
bar
\---
baz
"###,
&danger
)?,
r###"<p>Foo
bar
---
baz</p>
"###,
r###"Setext headings (106)"###
);
assert_eq!(
to_html_with_options(
r###" a simple
indented code block
"###,
&danger
)?,
r###"<pre><code>a simple
indented code block
</code></pre>
"###,
r###"Indented code blocks (107)"###
);
assert_eq!(
to_html_with_options(
r###" - foo
bar
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<p>bar</p>
</li>
</ul>
"###,
r###"Indented code blocks (108)"###
);
assert_eq!(
to_html_with_options(
r###"1. foo
- bar
"###,
&danger
)?,
r###"<ol>
<li>
<p>foo</p>
<ul>
<li>bar</li>
</ul>
</li>
</ol>
"###,
r###"Indented code blocks (109)"###
);
assert_eq!(
to_html_with_options(
r###" <a/>
*hi*
- one
"###,
&danger
)?,
r###"<pre><code>&lt;a/&gt;
*hi*
- one
</code></pre>
"###,
r###"Indented code blocks (110)"###
);
assert_eq!(
to_html_with_options(
r###" chunk1
chunk2
chunk3
"###,
&danger
)?,
r###"<pre><code>chunk1
chunk2
chunk3
</code></pre>
"###,
r###"Indented code blocks (111)"###
);
assert_eq!(
to_html_with_options(
r###" chunk1
chunk2
"###,
&danger
)?,
r###"<pre><code>chunk1
chunk2
</code></pre>
"###,
r###"Indented code blocks (112)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
bar
"###,
&danger
)?,
r###"<p>Foo
bar</p>
"###,
r###"Indented code blocks (113)"###
);
assert_eq!(
to_html_with_options(
r###" foo
bar
"###,
&danger
)?,
r###"<pre><code>foo
</code></pre>
<p>bar</p>
"###,
r###"Indented code blocks (114)"###
);
assert_eq!(
to_html_with_options(
r###"# Heading
foo
Heading
------
foo
----
"###,
&danger
)?,
r###"<h1>Heading</h1>
<pre><code>foo
</code></pre>
<h2>Heading</h2>
<pre><code>foo
</code></pre>
<hr />
"###,
r###"Indented code blocks (115)"###
);
assert_eq!(
to_html_with_options(
r###" foo
bar
"###,
&danger
)?,
r###"<pre><code> foo
bar
</code></pre>
"###,
r###"Indented code blocks (116)"###
);
assert_eq!(
to_html_with_options(
r###"
foo
"###,
&danger
)?,
r###"<pre><code>foo
</code></pre>
"###,
r###"Indented code blocks (117)"###
);
assert_eq!(
to_html_with_options(
r###" foo
"###,
&danger
)?,
r###"<pre><code>foo
</code></pre>
"###,
r###"Indented code blocks (118)"###
);
assert_eq!(
to_html_with_options(
r###"```
<
>
```
"###,
&danger
)?,
r###"<pre><code>&lt;
&gt;
</code></pre>
"###,
r###"Fenced code blocks (119)"###
);
assert_eq!(
to_html_with_options(
r###"~~~
<
>
~~~
"###,
&danger
)?,
r###"<pre><code>&lt;
&gt;
</code></pre>
"###,
r###"Fenced code blocks (120)"###
);
assert_eq!(
to_html_with_options(
r###"``
foo
``
"###,
&danger
)?,
r###"<p><code>foo</code></p>
"###,
r###"Fenced code blocks (121)"###
);
assert_eq!(
to_html_with_options(
r###"```
aaa
~~~
```
"###,
&danger
)?,
r###"<pre><code>aaa
~~~
</code></pre>
"###,
r###"Fenced code blocks (122)"###
);
assert_eq!(
to_html_with_options(
r###"~~~
aaa
```
~~~
"###,
&danger
)?,
r###"<pre><code>aaa
```
</code></pre>
"###,
r###"Fenced code blocks (123)"###
);
assert_eq!(
to_html_with_options(
r###"````
aaa
```
``````
"###,
&danger
)?,
r###"<pre><code>aaa
```
</code></pre>
"###,
r###"Fenced code blocks (124)"###
);
assert_eq!(
to_html_with_options(
r###"~~~~
aaa
~~~
~~~~
"###,
&danger
)?,
r###"<pre><code>aaa
~~~
</code></pre>
"###,
r###"Fenced code blocks (125)"###
);
assert_eq!(
to_html_with_options(
r###"```
"###,
&danger
)?,
r###"<pre><code></code></pre>
"###,
r###"Fenced code blocks (126)"###
);
assert_eq!(
to_html_with_options(
r###"`````
```
aaa
"###,
&danger
)?,
r###"<pre><code>
```
aaa
</code></pre>
"###,
r###"Fenced code blocks (127)"###
);
assert_eq!(
to_html_with_options(
r###"> ```
> aaa
bbb
"###,
&danger
)?,
r###"<blockquote>
<pre><code>aaa
</code></pre>
</blockquote>
<p>bbb</p>
"###,
r###"Fenced code blocks (128)"###
);
assert_eq!(
to_html_with_options(
r###"```
```
"###,
&danger
)?,
r###"<pre><code>
</code></pre>
"###,
r###"Fenced code blocks (129)"###
);
assert_eq!(
to_html_with_options(
r###"```
```
"###,
&danger
)?,
r###"<pre><code></code></pre>
"###,
r###"Fenced code blocks (130)"###
);
assert_eq!(
to_html_with_options(
r###" ```
aaa
aaa
```
"###,
&danger
)?,
r###"<pre><code>aaa
aaa
</code></pre>
"###,
r###"Fenced code blocks (131)"###
);
assert_eq!(
to_html_with_options(
r###" ```
aaa
aaa
aaa
```
"###,
&danger
)?,
r###"<pre><code>aaa
aaa
aaa
</code></pre>
"###,
r###"Fenced code blocks (132)"###
);
assert_eq!(
to_html_with_options(
r###" ```
aaa
aaa
aaa
```
"###,
&danger
)?,
r###"<pre><code>aaa
aaa
aaa
</code></pre>
"###,
r###"Fenced code blocks (133)"###
);
assert_eq!(
to_html_with_options(
r###" ```
aaa
```
"###,
&danger
)?,
r###"<pre><code>```
aaa
```
</code></pre>
"###,
r###"Fenced code blocks (134)"###
);
assert_eq!(
to_html_with_options(
r###"```
aaa
```
"###,
&danger
)?,
r###"<pre><code>aaa
</code></pre>
"###,
r###"Fenced code blocks (135)"###
);
assert_eq!(
to_html_with_options(
r###" ```
aaa
```
"###,
&danger
)?,
r###"<pre><code>aaa
</code></pre>
"###,
r###"Fenced code blocks (136)"###
);
assert_eq!(
to_html_with_options(
r###"```
aaa
```
"###,
&danger
)?,
r###"<pre><code>aaa
```
</code></pre>
"###,
r###"Fenced code blocks (137)"###
);
assert_eq!(
to_html_with_options(
r###"``` ```
aaa
"###,
&danger
)?,
r###"<p><code> </code>
aaa</p>
"###,
r###"Fenced code blocks (138)"###
);
assert_eq!(
to_html_with_options(
r###"~~~~~~
aaa
~~~ ~~
"###,
&danger
)?,
r###"<pre><code>aaa
~~~ ~~
</code></pre>
"###,
r###"Fenced code blocks (139)"###
);
assert_eq!(
to_html_with_options(
r###"foo
```
bar
```
baz
"###,
&danger
)?,
r###"<p>foo</p>
<pre><code>bar
</code></pre>
<p>baz</p>
"###,
r###"Fenced code blocks (140)"###
);
assert_eq!(
to_html_with_options(
r###"foo
---
~~~
bar
~~~
# baz
"###,
&danger
)?,
r###"<h2>foo</h2>
<pre><code>bar
</code></pre>
<h1>baz</h1>
"###,
r###"Fenced code blocks (141)"###
);
assert_eq!(
to_html_with_options(
r###"```ruby
def foo(x)
return 3
end
```
"###,
&danger
)?,
r###"<pre><code class="language-ruby">def foo(x)
return 3
end
</code></pre>
"###,
r###"Fenced code blocks (142)"###
);
assert_eq!(
to_html_with_options(
r###"~~~~ ruby startline=3 $%@#$
def foo(x)
return 3
end
~~~~~~~
"###,
&danger
)?,
r###"<pre><code class="language-ruby">def foo(x)
return 3
end
</code></pre>
"###,
r###"Fenced code blocks (143)"###
);
assert_eq!(
to_html_with_options(
r###"````;
````
"###,
&danger
)?,
r###"<pre><code class="language-;"></code></pre>
"###,
r###"Fenced code blocks (144)"###
);
assert_eq!(
to_html_with_options(
r###"``` aa ```
foo
"###,
&danger
)?,
r###"<p><code>aa</code>
foo</p>
"###,
r###"Fenced code blocks (145)"###
);
assert_eq!(
to_html_with_options(
r###"~~~ aa ``` ~~~
foo
~~~
"###,
&danger
)?,
r###"<pre><code class="language-aa">foo
</code></pre>
"###,
r###"Fenced code blocks (146)"###
);
assert_eq!(
to_html_with_options(
r###"```
``` aaa
```
"###,
&danger
)?,
r###"<pre><code>``` aaa
</code></pre>
"###,
r###"Fenced code blocks (147)"###
);
assert_eq!(
to_html_with_options(
r###"<table><tr><td>
<pre>
**Hello**,
_world_.
</pre>
</td></tr></table>
"###,
&danger
)?,
r###"<table><tr><td>
<pre>
**Hello**,
<p><em>world</em>.
</pre></p>
</td></tr></table>
"###,
r###"HTML blocks (148)"###
);
assert_eq!(
to_html_with_options(
r###"<table>
<tr>
<td>
hi
</td>
</tr>
</table>
okay.
"###,
&danger
)?,
r###"<table>
<tr>
<td>
hi
</td>
</tr>
</table>
<p>okay.</p>
"###,
r###"HTML blocks (149)"###
);
assert_eq!(
to_html_with_options(
r###" <div>
*hello*
<foo><a>
"###,
&danger
)?,
r###" <div>
*hello*
<foo><a>
"###,
r###"HTML blocks (150)"###
);
assert_eq!(
to_html_with_options(
r###"</div>
*foo*
"###,
&danger
)?,
r###"</div>
*foo*
"###,
r###"HTML blocks (151)"###
);
assert_eq!(
to_html_with_options(
r###"<DIV CLASS="foo">
*Markdown*
</DIV>
"###,
&danger
)?,
r###"<DIV CLASS="foo">
<p><em>Markdown</em></p>
</DIV>
"###,
r###"HTML blocks (152)"###
);
assert_eq!(
to_html_with_options(
r###"<div id="foo"
class="bar">
</div>
"###,
&danger
)?,
r###"<div id="foo"
class="bar">
</div>
"###,
r###"HTML blocks (153)"###
);
assert_eq!(
to_html_with_options(
r###"<div id="foo" class="bar
baz">
</div>
"###,
&danger
)?,
r###"<div id="foo" class="bar
baz">
</div>
"###,
r###"HTML blocks (154)"###
);
assert_eq!(
to_html_with_options(
r###"<div>
*foo*
*bar*
"###,
&danger
)?,
r###"<div>
*foo*
<p><em>bar</em></p>
"###,
r###"HTML blocks (155)"###
);
assert_eq!(
to_html_with_options(
r###"<div id="foo"
*hi*
"###,
&danger
)?,
r###"<div id="foo"
*hi*
"###,
r###"HTML blocks (156)"###
);
assert_eq!(
to_html_with_options(
r###"<div class
foo
"###,
&danger
)?,
r###"<div class
foo
"###,
r###"HTML blocks (157)"###
);
assert_eq!(
to_html_with_options(
r###"<div *???-&&&-<---
*foo*
"###,
&danger
)?,
r###"<div *???-&&&-<---
*foo*
"###,
r###"HTML blocks (158)"###
);
assert_eq!(
to_html_with_options(
r###"<div><a href="bar">*foo*</a></div>
"###,
&danger
)?,
r###"<div><a href="bar">*foo*</a></div>
"###,
r###"HTML blocks (159)"###
);
assert_eq!(
to_html_with_options(
r###"<table><tr><td>
foo
</td></tr></table>
"###,
&danger
)?,
r###"<table><tr><td>
foo
</td></tr></table>
"###,
r###"HTML blocks (160)"###
);
assert_eq!(
to_html_with_options(
r###"<div></div>
``` c
int x = 33;
```
"###,
&danger
)?,
r###"<div></div>
``` c
int x = 33;
```
"###,
r###"HTML blocks (161)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="foo">
*bar*
</a>
"###,
&danger
)?,
r###"<a href="foo">
*bar*
</a>
"###,
r###"HTML blocks (162)"###
);
assert_eq!(
to_html_with_options(
r###"<Warning>
*bar*
</Warning>
"###,
&danger
)?,
r###"<Warning>
*bar*
</Warning>
"###,
r###"HTML blocks (163)"###
);
assert_eq!(
to_html_with_options(
r###"<i class="foo">
*bar*
</i>
"###,
&danger
)?,
r###"<i class="foo">
*bar*
</i>
"###,
r###"HTML blocks (164)"###
);
assert_eq!(
to_html_with_options(
r###"</ins>
*bar*
"###,
&danger
)?,
r###"</ins>
*bar*
"###,
r###"HTML blocks (165)"###
);
assert_eq!(
to_html_with_options(
r###"<del>
*foo*
</del>
"###,
&danger
)?,
r###"<del>
*foo*
</del>
"###,
r###"HTML blocks (166)"###
);
assert_eq!(
to_html_with_options(
r###"<del>
*foo*
</del>
"###,
&danger
)?,
r###"<del>
<p><em>foo</em></p>
</del>
"###,
r###"HTML blocks (167)"###
);
assert_eq!(
to_html_with_options(
r###"<del>*foo*</del>
"###,
&danger
)?,
r###"<p><del><em>foo</em></del></p>
"###,
r###"HTML blocks (168)"###
);
assert_eq!(
to_html_with_options(
r###"<pre language="haskell"><code>
import Text.HTML.TagSoup
main :: IO ()
main = print $ parseTags tags
</code></pre>
okay
"###,
&danger
)?,
r###"<pre language="haskell"><code>
import Text.HTML.TagSoup
main :: IO ()
main = print $ parseTags tags
</code></pre>
<p>okay</p>
"###,
r###"HTML blocks (169)"###
);
assert_eq!(
to_html_with_options(
r###"<script type="text/javascript">
// JavaScript example
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
okay
"###,
&danger
)?,
r###"<script type="text/javascript">
// JavaScript example
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
<p>okay</p>
"###,
r###"HTML blocks (170)"###
);
assert_eq!(
to_html_with_options(
r###"<textarea>
*foo*
_bar_
</textarea>
"###,
&danger
)?,
r###"<textarea>
*foo*
_bar_
</textarea>
"###,
r###"HTML blocks (171)"###
);
assert_eq!(
to_html_with_options(
r###"<style
type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
okay
"###,
&danger
)?,
r###"<style
type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
<p>okay</p>
"###,
r###"HTML blocks (172)"###
);
assert_eq!(
to_html_with_options(
r###"<style
type="text/css">
foo
"###,
&danger
)?,
r###"<style
type="text/css">
foo
"###,
r###"HTML blocks (173)"###
);
assert_eq!(
to_html_with_options(
r###"> <div>
> foo
bar
"###,
&danger
)?,
r###"<blockquote>
<div>
foo
</blockquote>
<p>bar</p>
"###,
r###"HTML blocks (174)"###
);
assert_eq!(
to_html_with_options(
r###"- <div>
- foo
"###,
&danger
)?,
r###"<ul>
<li>
<div>
</li>
<li>foo</li>
</ul>
"###,
r###"HTML blocks (175)"###
);
assert_eq!(
to_html_with_options(
r###"<style>p{color:red;}</style>
*foo*
"###,
&danger
)?,
r###"<style>p{color:red;}</style>
<p><em>foo</em></p>
"###,
r###"HTML blocks (176)"###
);
assert_eq!(
to_html_with_options(
r###"<!-- foo -->*bar*
*baz*
"###,
&danger
)?,
r###"<!-- foo -->*bar*
<p><em>baz</em></p>
"###,
r###"HTML blocks (177)"###
);
assert_eq!(
to_html_with_options(
r###"<script>
foo
</script>1. *bar*
"###,
&danger
)?,
r###"<script>
foo
</script>1. *bar*
"###,
r###"HTML blocks (178)"###
);
assert_eq!(
to_html_with_options(
r###"<!-- Foo
bar
baz -->
okay
"###,
&danger
)?,
r###"<!-- Foo
bar
baz -->
<p>okay</p>
"###,
r###"HTML blocks (179)"###
);
assert_eq!(
to_html_with_options(
r###"<?php
echo '>';
?>
okay
"###,
&danger
)?,
r###"<?php
echo '>';
?>
<p>okay</p>
"###,
r###"HTML blocks (180)"###
);
assert_eq!(
to_html_with_options(
r###"<!DOCTYPE html>
"###,
&danger
)?,
r###"<!DOCTYPE html>
"###,
r###"HTML blocks (181)"###
);
assert_eq!(
to_html_with_options(
r###"<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then {
return 1;
} else {
return 0;
}
}
]]>
okay
"###,
&danger
)?,
r###"<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then {
return 1;
} else {
return 0;
}
}
]]>
<p>okay</p>
"###,
r###"HTML blocks (182)"###
);
assert_eq!(
to_html_with_options(
r###" <!-- foo -->
<!-- foo -->
"###,
&danger
)?,
r###" <!-- foo -->
<pre><code>&lt;!-- foo --&gt;
</code></pre>
"###,
r###"HTML blocks (183)"###
);
assert_eq!(
to_html_with_options(
r###" <div>
<div>
"###,
&danger
)?,
r###" <div>
<pre><code>&lt;div&gt;
</code></pre>
"###,
r###"HTML blocks (184)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
<div>
bar
</div>
"###,
&danger
)?,
r###"<p>Foo</p>
<div>
bar
</div>
"###,
r###"HTML blocks (185)"###
);
assert_eq!(
to_html_with_options(
r###"<div>
bar
</div>
*foo*
"###,
&danger
)?,
r###"<div>
bar
</div>
*foo*
"###,
r###"HTML blocks (186)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
<a href="bar">
baz
"###,
&danger
)?,
r###"<p>Foo
<a href="bar">
baz</p>
"###,
r###"HTML blocks (187)"###
);
assert_eq!(
to_html_with_options(
r###"<div>
*Emphasized* text.
</div>
"###,
&danger
)?,
r###"<div>
<p><em>Emphasized</em> text.</p>
</div>
"###,
r###"HTML blocks (188)"###
);
assert_eq!(
to_html_with_options(
r###"<div>
*Emphasized* text.
</div>
"###,
&danger
)?,
r###"<div>
*Emphasized* text.
</div>
"###,
r###"HTML blocks (189)"###
);
assert_eq!(
to_html_with_options(
r###"<table>
<tr>
<td>
Hi
</td>
</tr>
</table>
"###,
&danger
)?,
r###"<table>
<tr>
<td>
Hi
</td>
</tr>
</table>
"###,
r###"HTML blocks (190)"###
);
assert_eq!(
to_html_with_options(
r###"<table>
<tr>
<td>
Hi
</td>
</tr>
</table>
"###,
&danger
)?,
r###"<table>
<tr>
<pre><code>&lt;td&gt;
Hi
&lt;/td&gt;
</code></pre>
</tr>
</table>
"###,
r###"HTML blocks (191)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url "title"
[foo]
"###,
&danger
)?,
r###"<p><a href="/url" title="title">foo</a></p>
"###,
r###"Link reference definitions (192)"###
);
assert_eq!(
to_html_with_options(
r###" [foo]:
/url
'the title'
[foo]
"###,
&danger
)?,
r###"<p><a href="/url" title="the title">foo</a></p>
"###,
r###"Link reference definitions (193)"###
);
assert_eq!(
to_html_with_options(
r###"[Foo*bar\]]:my_(url) 'title (with parens)'
[Foo*bar\]]
"###,
&danger
)?,
r###"<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p>
"###,
r###"Link reference definitions (194)"###
);
assert_eq!(
to_html_with_options(
r###"[Foo bar]:
<my url>
'title'
[Foo bar]
"###,
&danger
)?,
r###"<p><a href="my%20url" title="title">Foo bar</a></p>
"###,
r###"Link reference definitions (195)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url '
title
line1
line2
'
[foo]
"###,
&danger
)?,
r###"<p><a href="/url" title="
title
line1
line2
">foo</a></p>
"###,
r###"Link reference definitions (196)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url 'title
with blank line'
[foo]
"###,
&danger
)?,
r###"<p>[foo]: /url 'title</p>
<p>with blank line'</p>
<p>[foo]</p>
"###,
r###"Link reference definitions (197)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]:
/url
[foo]
"###,
&danger
)?,
r###"<p><a href="/url">foo</a></p>
"###,
r###"Link reference definitions (198)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]:
[foo]
"###,
&danger
)?,
r###"<p>[foo]:</p>
<p>[foo]</p>
"###,
r###"Link reference definitions (199)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: <>
[foo]
"###,
&danger
)?,
r###"<p><a href="">foo</a></p>
"###,
r###"Link reference definitions (200)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: <bar>(baz)
[foo]
"###,
&danger
)?,
r###"<p>[foo]: <bar>(baz)</p>
<p>[foo]</p>
"###,
r###"Link reference definitions (201)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url\bar\*baz "foo\"bar\baz"
[foo]
"###,
&danger
)?,
r###"<p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p>
"###,
r###"Link reference definitions (202)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[foo]: url
"###,
&danger
)?,
r###"<p><a href="url">foo</a></p>
"###,
r###"Link reference definitions (203)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[foo]: first
[foo]: second
"###,
&danger
)?,
r###"<p><a href="first">foo</a></p>
"###,
r###"Link reference definitions (204)"###
);
assert_eq!(
to_html_with_options(
r###"[FOO]: /url
[Foo]
"###,
&danger
)?,
r###"<p><a href="/url">Foo</a></p>
"###,
r###"Link reference definitions (205)"###
);
assert_eq!(
to_html_with_options(
r###"[ΑΓΩ]: /φου
[αγω]
"###,
&danger
)?,
r###"<p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p>
"###,
r###"Link reference definitions (206)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url
"###,
&danger
)?,
r###""###,
r###"Link reference definitions (207)"###
);
assert_eq!(
to_html_with_options(
r###"[
foo
]: /url
bar
"###,
&danger
)?,
r###"<p>bar</p>
"###,
r###"Link reference definitions (208)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url "title" ok
"###,
&danger
)?,
r###"<p>[foo]: /url &quot;title&quot; ok</p>
"###,
r###"Link reference definitions (209)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url
"title" ok
"###,
&danger
)?,
r###"<p>&quot;title&quot; ok</p>
"###,
r###"Link reference definitions (210)"###
);
assert_eq!(
to_html_with_options(
r###" [foo]: /url "title"
[foo]
"###,
&danger
)?,
r###"<pre><code>[foo]: /url &quot;title&quot;
</code></pre>
<p>[foo]</p>
"###,
r###"Link reference definitions (211)"###
);
assert_eq!(
to_html_with_options(
r###"```
[foo]: /url
```
[foo]
"###,
&danger
)?,
r###"<pre><code>[foo]: /url
</code></pre>
<p>[foo]</p>
"###,
r###"Link reference definitions (212)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
[bar]: /baz
[bar]
"###,
&danger
)?,
r###"<p>Foo
[bar]: /baz</p>
<p>[bar]</p>
"###,
r###"Link reference definitions (213)"###
);
assert_eq!(
to_html_with_options(
r###"# [Foo]
[foo]: /url
> bar
"###,
&danger
)?,
r###"<h1><a href="/url">Foo</a></h1>
<blockquote>
<p>bar</p>
</blockquote>
"###,
r###"Link reference definitions (214)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url
bar
===
[foo]
"###,
&danger
)?,
r###"<h1>bar</h1>
<p><a href="/url">foo</a></p>
"###,
r###"Link reference definitions (215)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url
===
[foo]
"###,
&danger
)?,
r###"<p>===
<a href="/url">foo</a></p>
"###,
r###"Link reference definitions (216)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /foo-url "foo"
[bar]: /bar-url
"bar"
[baz]: /baz-url
[foo],
[bar],
[baz]
"###,
&danger
)?,
r###"<p><a href="/foo-url" title="foo">foo</a>,
<a href="/bar-url" title="bar">bar</a>,
<a href="/baz-url">baz</a></p>
"###,
r###"Link reference definitions (217)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
> [foo]: /url
"###,
&danger
)?,
r###"<p><a href="/url">foo</a></p>
<blockquote>
</blockquote>
"###,
r###"Link reference definitions (218)"###
);
assert_eq!(
to_html_with_options(
r###"aaa
bbb
"###,
&danger
)?,
r###"<p>aaa</p>
<p>bbb</p>
"###,
r###"Paragraphs (219)"###
);
assert_eq!(
to_html_with_options(
r###"aaa
bbb
ccc
ddd
"###,
&danger
)?,
r###"<p>aaa
bbb</p>
<p>ccc
ddd</p>
"###,
r###"Paragraphs (220)"###
);
assert_eq!(
to_html_with_options(
r###"aaa
bbb
"###,
&danger
)?,
r###"<p>aaa</p>
<p>bbb</p>
"###,
r###"Paragraphs (221)"###
);
assert_eq!(
to_html_with_options(
r###" aaa
bbb
"###,
&danger
)?,
r###"<p>aaa
bbb</p>
"###,
r###"Paragraphs (222)"###
);
assert_eq!(
to_html_with_options(
r###"aaa
bbb
ccc
"###,
&danger
)?,
r###"<p>aaa
bbb
ccc</p>
"###,
r###"Paragraphs (223)"###
);
assert_eq!(
to_html_with_options(
r###" aaa
bbb
"###,
&danger
)?,
r###"<p>aaa
bbb</p>
"###,
r###"Paragraphs (224)"###
);
assert_eq!(
to_html_with_options(
r###" aaa
bbb
"###,
&danger
)?,
r###"<pre><code>aaa
</code></pre>
<p>bbb</p>
"###,
r###"Paragraphs (225)"###
);
assert_eq!(
to_html_with_options(
r###"aaa
bbb
"###,
&danger
)?,
r###"<p>aaa<br />
bbb</p>
"###,
r###"Paragraphs (226)"###
);
assert_eq!(
to_html_with_options(
r###"
aaa
# aaa
"###,
&danger
)?,
r###"<p>aaa</p>
<h1>aaa</h1>
"###,
r###"Blank lines (227)"###
);
assert_eq!(
to_html_with_options(
r###"> # Foo
> bar
> baz
"###,
&danger
)?,
r###"<blockquote>
<h1>Foo</h1>
<p>bar
baz</p>
</blockquote>
"###,
r###"Block quotes (228)"###
);
assert_eq!(
to_html_with_options(
r###"># Foo
>bar
> baz
"###,
&danger
)?,
r###"<blockquote>
<h1>Foo</h1>
<p>bar
baz</p>
</blockquote>
"###,
r###"Block quotes (229)"###
);
assert_eq!(
to_html_with_options(
r###" > # Foo
> bar
> baz
"###,
&danger
)?,
r###"<blockquote>
<h1>Foo</h1>
<p>bar
baz</p>
</blockquote>
"###,
r###"Block quotes (230)"###
);
assert_eq!(
to_html_with_options(
r###" > # Foo
> bar
> baz
"###,
&danger
)?,
r###"<pre><code>&gt; # Foo
&gt; bar
&gt; baz
</code></pre>
"###,
r###"Block quotes (231)"###
);
assert_eq!(
to_html_with_options(
r###"> # Foo
> bar
baz
"###,
&danger
)?,
r###"<blockquote>
<h1>Foo</h1>
<p>bar
baz</p>
</blockquote>
"###,
r###"Block quotes (232)"###
);
assert_eq!(
to_html_with_options(
r###"> bar
baz
> foo
"###,
&danger
)?,
r###"<blockquote>
<p>bar
baz
foo</p>
</blockquote>
"###,
r###"Block quotes (233)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
---
"###,
&danger
)?,
r###"<blockquote>
<p>foo</p>
</blockquote>
<hr />
"###,
r###"Block quotes (234)"###
);
assert_eq!(
to_html_with_options(
r###"> - foo
- bar
"###,
&danger
)?,
r###"<blockquote>
<ul>
<li>foo</li>
</ul>
</blockquote>
<ul>
<li>bar</li>
</ul>
"###,
r###"Block quotes (235)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
bar
"###,
&danger
)?,
r###"<blockquote>
<pre><code>foo
</code></pre>
</blockquote>
<pre><code>bar
</code></pre>
"###,
r###"Block quotes (236)"###
);
assert_eq!(
to_html_with_options(
r###"> ```
foo
```
"###,
&danger
)?,
r###"<blockquote>
<pre><code></code></pre>
</blockquote>
<p>foo</p>
<pre><code></code></pre>
"###,
r###"Block quotes (237)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
- bar
"###,
&danger
)?,
r###"<blockquote>
<p>foo
- bar</p>
</blockquote>
"###,
r###"Block quotes (238)"###
);
assert_eq!(
to_html_with_options(
r###">
"###,
&danger
)?,
r###"<blockquote>
</blockquote>
"###,
r###"Block quotes (239)"###
);
assert_eq!(
to_html_with_options(
r###">
>
>
"###,
&danger
)?,
r###"<blockquote>
</blockquote>
"###,
r###"Block quotes (240)"###
);
assert_eq!(
to_html_with_options(
r###">
> foo
>
"###,
&danger
)?,
r###"<blockquote>
<p>foo</p>
</blockquote>
"###,
r###"Block quotes (241)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
> bar
"###,
&danger
)?,
r###"<blockquote>
<p>foo</p>
</blockquote>
<blockquote>
<p>bar</p>
</blockquote>
"###,
r###"Block quotes (242)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
> bar
"###,
&danger
)?,
r###"<blockquote>
<p>foo
bar</p>
</blockquote>
"###,
r###"Block quotes (243)"###
);
assert_eq!(
to_html_with_options(
r###"> foo
>
> bar
"###,
&danger
)?,
r###"<blockquote>
<p>foo</p>
<p>bar</p>
</blockquote>
"###,
r###"Block quotes (244)"###
);
assert_eq!(
to_html_with_options(
r###"foo
> bar
"###,
&danger
)?,
r###"<p>foo</p>
<blockquote>
<p>bar</p>
</blockquote>
"###,
r###"Block quotes (245)"###
);
assert_eq!(
to_html_with_options(
r###"> aaa
***
> bbb
"###,
&danger
)?,
r###"<blockquote>
<p>aaa</p>
</blockquote>
<hr />
<blockquote>
<p>bbb</p>
</blockquote>
"###,
r###"Block quotes (246)"###
);
assert_eq!(
to_html_with_options(
r###"> bar
baz
"###,
&danger
)?,
r###"<blockquote>
<p>bar
baz</p>
</blockquote>
"###,
r###"Block quotes (247)"###
);
assert_eq!(
to_html_with_options(
r###"> bar
baz
"###,
&danger
)?,
r###"<blockquote>
<p>bar</p>
</blockquote>
<p>baz</p>
"###,
r###"Block quotes (248)"###
);
assert_eq!(
to_html_with_options(
r###"> bar
>
baz
"###,
&danger
)?,
r###"<blockquote>
<p>bar</p>
</blockquote>
<p>baz</p>
"###,
r###"Block quotes (249)"###
);
assert_eq!(
to_html_with_options(
r###"> > > foo
bar
"###,
&danger
)?,
r###"<blockquote>
<blockquote>
<blockquote>
<p>foo
bar</p>
</blockquote>
</blockquote>
</blockquote>
"###,
r###"Block quotes (250)"###
);
assert_eq!(
to_html_with_options(
r###">>> foo
> bar
>>baz
"###,
&danger
)?,
r###"<blockquote>
<blockquote>
<blockquote>
<p>foo
bar
baz</p>
</blockquote>
</blockquote>
</blockquote>
"###,
r###"Block quotes (251)"###
);
assert_eq!(
to_html_with_options(
r###"> code
> not code
"###,
&danger
)?,
r###"<blockquote>
<pre><code>code
</code></pre>
</blockquote>
<blockquote>
<p>not code</p>
</blockquote>
"###,
r###"Block quotes (252)"###
);
assert_eq!(
to_html_with_options(
r###"A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<p>A paragraph
with two lines.</p>
<pre><code>indented code
</code></pre>
<blockquote>
<p>A block quote.</p>
</blockquote>
"###,
r###"List items (253)"###
);
assert_eq!(
to_html_with_options(
r###"1. A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<ol>
<li>
<p>A paragraph
with two lines.</p>
<pre><code>indented code
</code></pre>
<blockquote>
<p>A block quote.</p>
</blockquote>
</li>
</ol>
"###,
r###"List items (254)"###
);
assert_eq!(
to_html_with_options(
r###"- one
two
"###,
&danger
)?,
r###"<ul>
<li>one</li>
</ul>
<p>two</p>
"###,
r###"List items (255)"###
);
assert_eq!(
to_html_with_options(
r###"- one
two
"###,
&danger
)?,
r###"<ul>
<li>
<p>one</p>
<p>two</p>
</li>
</ul>
"###,
r###"List items (256)"###
);
assert_eq!(
to_html_with_options(
r###" - one
two
"###,
&danger
)?,
r###"<ul>
<li>one</li>
</ul>
<pre><code> two
</code></pre>
"###,
r###"List items (257)"###
);
assert_eq!(
to_html_with_options(
r###" - one
two
"###,
&danger
)?,
r###"<ul>
<li>
<p>one</p>
<p>two</p>
</li>
</ul>
"###,
r###"List items (258)"###
);
assert_eq!(
to_html_with_options(
r###" > > 1. one
>>
>> two
"###,
&danger
)?,
r###"<blockquote>
<blockquote>
<ol>
<li>
<p>one</p>
<p>two</p>
</li>
</ol>
</blockquote>
</blockquote>
"###,
r###"List items (259)"###
);
assert_eq!(
to_html_with_options(
r###">>- one
>>
> > two
"###,
&danger
)?,
r###"<blockquote>
<blockquote>
<ul>
<li>one</li>
</ul>
<p>two</p>
</blockquote>
</blockquote>
"###,
r###"List items (260)"###
);
assert_eq!(
to_html_with_options(
r###"-one
2.two
"###,
&danger
)?,
r###"<p>-one</p>
<p>2.two</p>
"###,
r###"List items (261)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
bar
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<p>bar</p>
</li>
</ul>
"###,
r###"List items (262)"###
);
assert_eq!(
to_html_with_options(
r###"1. foo
```
bar
```
baz
> bam
"###,
&danger
)?,
r###"<ol>
<li>
<p>foo</p>
<pre><code>bar
</code></pre>
<p>baz</p>
<blockquote>
<p>bam</p>
</blockquote>
</li>
</ol>
"###,
r###"List items (263)"###
);
assert_eq!(
to_html_with_options(
r###"- Foo
bar
baz
"###,
&danger
)?,
r###"<ul>
<li>
<p>Foo</p>
<pre><code>bar
baz
</code></pre>
</li>
</ul>
"###,
r###"List items (264)"###
);
assert_eq!(
to_html_with_options(
r###"123456789. ok
"###,
&danger
)?,
r###"<ol start="123456789">
<li>ok</li>
</ol>
"###,
r###"List items (265)"###
);
assert_eq!(
to_html_with_options(
r###"1234567890. not ok
"###,
&danger
)?,
r###"<p>1234567890. not ok</p>
"###,
r###"List items (266)"###
);
assert_eq!(
to_html_with_options(
r###"0. ok
"###,
&danger
)?,
r###"<ol start="0">
<li>ok</li>
</ol>
"###,
r###"List items (267)"###
);
assert_eq!(
to_html_with_options(
r###"003. ok
"###,
&danger
)?,
r###"<ol start="3">
<li>ok</li>
</ol>
"###,
r###"List items (268)"###
);
assert_eq!(
to_html_with_options(
r###"-1. not ok
"###,
&danger
)?,
r###"<p>-1. not ok</p>
"###,
r###"List items (269)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
bar
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<pre><code>bar
</code></pre>
</li>
</ul>
"###,
r###"List items (270)"###
);
assert_eq!(
to_html_with_options(
r###" 10. foo
bar
"###,
&danger
)?,
r###"<ol start="10">
<li>
<p>foo</p>
<pre><code>bar
</code></pre>
</li>
</ol>
"###,
r###"List items (271)"###
);
assert_eq!(
to_html_with_options(
r###" indented code
paragraph
more code
"###,
&danger
)?,
r###"<pre><code>indented code
</code></pre>
<p>paragraph</p>
<pre><code>more code
</code></pre>
"###,
r###"List items (272)"###
);
assert_eq!(
to_html_with_options(
r###"1. indented code
paragraph
more code
"###,
&danger
)?,
r###"<ol>
<li>
<pre><code>indented code
</code></pre>
<p>paragraph</p>
<pre><code>more code
</code></pre>
</li>
</ol>
"###,
r###"List items (273)"###
);
assert_eq!(
to_html_with_options(
r###"1. indented code
paragraph
more code
"###,
&danger
)?,
r###"<ol>
<li>
<pre><code> indented code
</code></pre>
<p>paragraph</p>
<pre><code>more code
</code></pre>
</li>
</ol>
"###,
r###"List items (274)"###
);
assert_eq!(
to_html_with_options(
r###" foo
bar
"###,
&danger
)?,
r###"<p>foo</p>
<p>bar</p>
"###,
r###"List items (275)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
bar
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
</ul>
<p>bar</p>
"###,
r###"List items (276)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
bar
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<p>bar</p>
</li>
</ul>
"###,
r###"List items (277)"###
);
assert_eq!(
to_html_with_options(
r###"-
foo
-
```
bar
```
-
baz
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
<li>
<pre><code>bar
</code></pre>
</li>
<li>
<pre><code>baz
</code></pre>
</li>
</ul>
"###,
r###"List items (278)"###
);
assert_eq!(
to_html_with_options(
r###"-
foo
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
</ul>
"###,
r###"List items (279)"###
);
assert_eq!(
to_html_with_options(
r###"-
foo
"###,
&danger
)?,
r###"<ul>
<li></li>
</ul>
<p>foo</p>
"###,
r###"List items (280)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
-
- bar
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
<li></li>
<li>bar</li>
</ul>
"###,
r###"List items (281)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
-
- bar
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
<li></li>
<li>bar</li>
</ul>
"###,
r###"List items (282)"###
);
assert_eq!(
to_html_with_options(
r###"1. foo
2.
3. bar
"###,
&danger
)?,
r###"<ol>
<li>foo</li>
<li></li>
<li>bar</li>
</ol>
"###,
r###"List items (283)"###
);
assert_eq!(
to_html_with_options(
r###"*
"###,
&danger
)?,
r###"<ul>
<li></li>
</ul>
"###,
r###"List items (284)"###
);
assert_eq!(
to_html_with_options(
r###"foo
*
foo
1.
"###,
&danger
)?,
r###"<p>foo
*</p>
<p>foo
1.</p>
"###,
r###"List items (285)"###
);
assert_eq!(
to_html_with_options(
r###" 1. A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<ol>
<li>
<p>A paragraph
with two lines.</p>
<pre><code>indented code
</code></pre>
<blockquote>
<p>A block quote.</p>
</blockquote>
</li>
</ol>
"###,
r###"List items (286)"###
);
assert_eq!(
to_html_with_options(
r###" 1. A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<ol>
<li>
<p>A paragraph
with two lines.</p>
<pre><code>indented code
</code></pre>
<blockquote>
<p>A block quote.</p>
</blockquote>
</li>
</ol>
"###,
r###"List items (287)"###
);
assert_eq!(
to_html_with_options(
r###" 1. A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<ol>
<li>
<p>A paragraph
with two lines.</p>
<pre><code>indented code
</code></pre>
<blockquote>
<p>A block quote.</p>
</blockquote>
</li>
</ol>
"###,
r###"List items (288)"###
);
assert_eq!(
to_html_with_options(
r###" 1. A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<pre><code>1. A paragraph
with two lines.
indented code
&gt; A block quote.
</code></pre>
"###,
r###"List items (289)"###
);
assert_eq!(
to_html_with_options(
r###" 1. A paragraph
with two lines.
indented code
> A block quote.
"###,
&danger
)?,
r###"<ol>
<li>
<p>A paragraph
with two lines.</p>
<pre><code>indented code
</code></pre>
<blockquote>
<p>A block quote.</p>
</blockquote>
</li>
</ol>
"###,
r###"List items (290)"###
);
assert_eq!(
to_html_with_options(
r###" 1. A paragraph
with two lines.
"###,
&danger
)?,
r###"<ol>
<li>A paragraph
with two lines.</li>
</ol>
"###,
r###"List items (291)"###
);
assert_eq!(
to_html_with_options(
r###"> 1. > Blockquote
continued here.
"###,
&danger
)?,
r###"<blockquote>
<ol>
<li>
<blockquote>
<p>Blockquote
continued here.</p>
</blockquote>
</li>
</ol>
</blockquote>
"###,
r###"List items (292)"###
);
assert_eq!(
to_html_with_options(
r###"> 1. > Blockquote
> continued here.
"###,
&danger
)?,
r###"<blockquote>
<ol>
<li>
<blockquote>
<p>Blockquote
continued here.</p>
</blockquote>
</li>
</ol>
</blockquote>
"###,
r###"List items (293)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
- bar
- baz
- boo
"###,
&danger
)?,
r###"<ul>
<li>foo
<ul>
<li>bar
<ul>
<li>baz
<ul>
<li>boo</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
"###,
r###"List items (294)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
- bar
- baz
- boo
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
<li>boo</li>
</ul>
"###,
r###"List items (295)"###
);
assert_eq!(
to_html_with_options(
r###"10) foo
- bar
"###,
&danger
)?,
r###"<ol start="10">
<li>foo
<ul>
<li>bar</li>
</ul>
</li>
</ol>
"###,
r###"List items (296)"###
);
assert_eq!(
to_html_with_options(
r###"10) foo
- bar
"###,
&danger
)?,
r###"<ol start="10">
<li>foo</li>
</ol>
<ul>
<li>bar</li>
</ul>
"###,
r###"List items (297)"###
);
assert_eq!(
to_html_with_options(
r###"- - foo
"###,
&danger
)?,
r###"<ul>
<li>
<ul>
<li>foo</li>
</ul>
</li>
</ul>
"###,
r###"List items (298)"###
);
assert_eq!(
to_html_with_options(
r###"1. - 2. foo
"###,
&danger
)?,
r###"<ol>
<li>
<ul>
<li>
<ol start="2">
<li>foo</li>
</ol>
</li>
</ul>
</li>
</ol>
"###,
r###"List items (299)"###
);
assert_eq!(
to_html_with_options(
r###"- # Foo
- Bar
---
baz
"###,
&danger
)?,
r###"<ul>
<li>
<h1>Foo</h1>
</li>
<li>
<h2>Bar</h2>
baz</li>
</ul>
"###,
r###"List items (300)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
- bar
+ baz
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
<li>bar</li>
</ul>
<ul>
<li>baz</li>
</ul>
"###,
r###"Lists (301)"###
);
assert_eq!(
to_html_with_options(
r###"1. foo
2. bar
3) baz
"###,
&danger
)?,
r###"<ol>
<li>foo</li>
<li>bar</li>
</ol>
<ol start="3">
<li>baz</li>
</ol>
"###,
r###"Lists (302)"###
);
assert_eq!(
to_html_with_options(
r###"Foo
- bar
- baz
"###,
&danger
)?,
r###"<p>Foo</p>
<ul>
<li>bar</li>
<li>baz</li>
</ul>
"###,
r###"Lists (303)"###
);
assert_eq!(
to_html_with_options(
r###"The number of windows in my house is
14. The number of doors is 6.
"###,
&danger
)?,
r###"<p>The number of windows in my house is
14. The number of doors is 6.</p>
"###,
r###"Lists (304)"###
);
assert_eq!(
to_html_with_options(
r###"The number of windows in my house is
1. The number of doors is 6.
"###,
&danger
)?,
r###"<p>The number of windows in my house is</p>
<ol>
<li>The number of doors is 6.</li>
</ol>
"###,
r###"Lists (305)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
- bar
- baz
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
</li>
<li>
<p>bar</p>
</li>
<li>
<p>baz</p>
</li>
</ul>
"###,
r###"Lists (306)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
- bar
- baz
bim
"###,
&danger
)?,
r###"<ul>
<li>foo
<ul>
<li>bar
<ul>
<li>
<p>baz</p>
<p>bim</p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
"###,
r###"Lists (307)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
- bar
<!-- -->
- baz
- bim
"###,
&danger
)?,
r###"<ul>
<li>foo</li>
<li>bar</li>
</ul>
<!-- -->
<ul>
<li>baz</li>
<li>bim</li>
</ul>
"###,
r###"Lists (308)"###
);
assert_eq!(
to_html_with_options(
r###"- foo
notcode
- foo
<!-- -->
code
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<p>notcode</p>
</li>
<li>
<p>foo</p>
</li>
</ul>
<!-- -->
<pre><code>code
</code></pre>
"###,
r###"Lists (309)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
- c
- d
- e
- f
- g
"###,
&danger
)?,
r###"<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
<li>f</li>
<li>g</li>
</ul>
"###,
r###"Lists (310)"###
);
assert_eq!(
to_html_with_options(
r###"1. a
2. b
3. c
"###,
&danger
)?,
r###"<ol>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
<li>
<p>c</p>
</li>
</ol>
"###,
r###"Lists (311)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
- c
- d
- e
"###,
&danger
)?,
r###"<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d
- e</li>
</ul>
"###,
r###"Lists (312)"###
);
assert_eq!(
to_html_with_options(
r###"1. a
2. b
3. c
"###,
&danger
)?,
r###"<ol>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
</ol>
<pre><code>3. c
</code></pre>
"###,
r###"Lists (313)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
- c
"###,
&danger
)?,
r###"<ul>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
<li>
<p>c</p>
</li>
</ul>
"###,
r###"Lists (314)"###
);
assert_eq!(
to_html_with_options(
r###"* a
*
* c
"###,
&danger
)?,
r###"<ul>
<li>
<p>a</p>
</li>
<li></li>
<li>
<p>c</p>
</li>
</ul>
"###,
r###"Lists (315)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
c
- d
"###,
&danger
)?,
r###"<ul>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
<p>c</p>
</li>
<li>
<p>d</p>
</li>
</ul>
"###,
r###"Lists (316)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
[ref]: /url
- d
"###,
&danger
)?,
r###"<ul>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
<li>
<p>d</p>
</li>
</ul>
"###,
r###"Lists (317)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- ```
b
```
- c
"###,
&danger
)?,
r###"<ul>
<li>a</li>
<li>
<pre><code>b
</code></pre>
</li>
<li>c</li>
</ul>
"###,
r###"Lists (318)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
c
- d
"###,
&danger
)?,
r###"<ul>
<li>a
<ul>
<li>
<p>b</p>
<p>c</p>
</li>
</ul>
</li>
<li>d</li>
</ul>
"###,
r###"Lists (319)"###
);
assert_eq!(
to_html_with_options(
r###"* a
> b
>
* c
"###,
&danger
)?,
r###"<ul>
<li>a
<blockquote>
<p>b</p>
</blockquote>
</li>
<li>c</li>
</ul>
"###,
r###"Lists (320)"###
);
assert_eq!(
to_html_with_options(
r###"- a
> b
```
c
```
- d
"###,
&danger
)?,
r###"<ul>
<li>a
<blockquote>
<p>b</p>
</blockquote>
<pre><code>c
</code></pre>
</li>
<li>d</li>
</ul>
"###,
r###"Lists (321)"###
);
assert_eq!(
to_html_with_options(
r###"- a
"###,
&danger
)?,
r###"<ul>
<li>a</li>
</ul>
"###,
r###"Lists (322)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
"###,
&danger
)?,
r###"<ul>
<li>a
<ul>
<li>b</li>
</ul>
</li>
</ul>
"###,
r###"Lists (323)"###
);
assert_eq!(
to_html_with_options(
r###"1. ```
foo
```
bar
"###,
&danger
)?,
r###"<ol>
<li>
<pre><code>foo
</code></pre>
<p>bar</p>
</li>
</ol>
"###,
r###"Lists (324)"###
);
assert_eq!(
to_html_with_options(
r###"* foo
* bar
baz
"###,
&danger
)?,
r###"<ul>
<li>
<p>foo</p>
<ul>
<li>bar</li>
</ul>
<p>baz</p>
</li>
</ul>
"###,
r###"Lists (325)"###
);
assert_eq!(
to_html_with_options(
r###"- a
- b
- c
- d
- e
- f
"###,
&danger
)?,
r###"<ul>
<li>
<p>a</p>
<ul>
<li>b</li>
<li>c</li>
</ul>
</li>
<li>
<p>d</p>
<ul>
<li>e</li>
<li>f</li>
</ul>
</li>
</ul>
"###,
r###"Lists (326)"###
);
assert_eq!(
to_html_with_options(
r###"`hi`lo`
"###,
&danger
)?,
r###"<p><code>hi</code>lo`</p>
"###,
r###"Inlines (327)"###
);
assert_eq!(
to_html_with_options(
r###"`foo`
"###,
&danger
)?,
r###"<p><code>foo</code></p>
"###,
r###"Code spans (328)"###
);
assert_eq!(
to_html_with_options(
r###"`` foo ` bar ``
"###,
&danger
)?,
r###"<p><code>foo ` bar</code></p>
"###,
r###"Code spans (329)"###
);
assert_eq!(
to_html_with_options(
r###"` `` `
"###,
&danger
)?,
r###"<p><code>``</code></p>
"###,
r###"Code spans (330)"###
);
assert_eq!(
to_html_with_options(
r###"` `` `
"###,
&danger
)?,
r###"<p><code> `` </code></p>
"###,
r###"Code spans (331)"###
);
assert_eq!(
to_html_with_options(
r###"` a`
"###,
&danger
)?,
r###"<p><code> a</code></p>
"###,
r###"Code spans (332)"###
);
assert_eq!(
to_html_with_options(
r###"` b `
"###,
&danger
)?,
r###"<p><code> b </code></p>
"###,
r###"Code spans (333)"###
);
assert_eq!(
to_html_with_options(
r###"` `
` `
"###,
&danger
)?,
r###"<p><code> </code>
<code> </code></p>
"###,
r###"Code spans (334)"###
);
assert_eq!(
to_html_with_options(
r###"``
foo
bar
baz
``
"###,
&danger
)?,
r###"<p><code>foo bar baz</code></p>
"###,
r###"Code spans (335)"###
);
assert_eq!(
to_html_with_options(
r###"``
foo
``
"###,
&danger
)?,
r###"<p><code>foo </code></p>
"###,
r###"Code spans (336)"###
);
assert_eq!(
to_html_with_options(
r###"`foo bar
baz`
"###,
&danger
)?,
r###"<p><code>foo bar baz</code></p>
"###,
r###"Code spans (337)"###
);
assert_eq!(
to_html_with_options(
r###"`foo\`bar`
"###,
&danger
)?,
r###"<p><code>foo\</code>bar`</p>
"###,
r###"Code spans (338)"###
);
assert_eq!(
to_html_with_options(
r###"``foo`bar``
"###,
&danger
)?,
r###"<p><code>foo`bar</code></p>
"###,
r###"Code spans (339)"###
);
assert_eq!(
to_html_with_options(
r###"` foo `` bar `
"###,
&danger
)?,
r###"<p><code>foo `` bar</code></p>
"###,
r###"Code spans (340)"###
);
assert_eq!(
to_html_with_options(
r###"*foo`*`
"###,
&danger
)?,
r###"<p>*foo<code>*</code></p>
"###,
r###"Code spans (341)"###
);
assert_eq!(
to_html_with_options(
r###"[not a `link](/foo`)
"###,
&danger
)?,
r###"<p>[not a <code>link](/foo</code>)</p>
"###,
r###"Code spans (342)"###
);
assert_eq!(
to_html_with_options(
r###"`<a href="`">`
"###,
&danger
)?,
r###"<p><code>&lt;a href=&quot;</code>&quot;&gt;`</p>
"###,
r###"Code spans (343)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="`">`
"###,
&danger
)?,
r###"<p><a href="`">`</p>
"###,
r###"Code spans (344)"###
);
assert_eq!(
to_html_with_options(
r###"`<https://foo.bar.`baz>`
"###,
&danger
)?,
r###"<p><code>&lt;https://foo.bar.</code>baz&gt;`</p>
"###,
r###"Code spans (345)"###
);
assert_eq!(
to_html_with_options(
r###"<https://foo.bar.`baz>`
"###,
&danger
)?,
r###"<p><a href="https://foo.bar.%60baz">https://foo.bar.`baz</a>`</p>
"###,
r###"Code spans (346)"###
);
assert_eq!(
to_html_with_options(
r###"```foo``
"###,
&danger
)?,
r###"<p>```foo``</p>
"###,
r###"Code spans (347)"###
);
assert_eq!(
to_html_with_options(
r###"`foo
"###,
&danger
)?,
r###"<p>`foo</p>
"###,
r###"Code spans (348)"###
);
assert_eq!(
to_html_with_options(
r###"`foo``bar``
"###,
&danger
)?,
r###"<p>`foo<code>bar</code></p>
"###,
r###"Code spans (349)"###
);
assert_eq!(
to_html_with_options(
r###"*foo bar*
"###,
&danger
)?,
r###"<p><em>foo bar</em></p>
"###,
r###"Emphasis and strong emphasis (350)"###
);
assert_eq!(
to_html_with_options(
r###"a * foo bar*
"###,
&danger
)?,
r###"<p>a * foo bar*</p>
"###,
r###"Emphasis and strong emphasis (351)"###
);
assert_eq!(
to_html_with_options(
r###"a*"foo"*
"###,
&danger
)?,
r###"<p>a*&quot;foo&quot;*</p>
"###,
r###"Emphasis and strong emphasis (352)"###
);
assert_eq!(
to_html_with_options(
r###"* a *
"###,
&danger
)?,
r###"<p>* a *</p>
"###,
r###"Emphasis and strong emphasis (353)"###
);
assert_eq!(
to_html_with_options(
r###"*$*alpha.
*£*bravo.
*€*charlie.
"###,
&danger
)?,
r###"<p>*$*alpha.</p>
<p>*£*bravo.</p>
<p>*€*charlie.</p>
"###,
r###"Emphasis and strong emphasis (354)"###
);
assert_eq!(
to_html_with_options(
r###"foo*bar*
"###,
&danger
)?,
r###"<p>foo<em>bar</em></p>
"###,
r###"Emphasis and strong emphasis (355)"###
);
assert_eq!(
to_html_with_options(
r###"5*6*78
"###,
&danger
)?,
r###"<p>5<em>6</em>78</p>
"###,
r###"Emphasis and strong emphasis (356)"###
);
assert_eq!(
to_html_with_options(
r###"_foo bar_
"###,
&danger
)?,
r###"<p><em>foo bar</em></p>
"###,
r###"Emphasis and strong emphasis (357)"###
);
assert_eq!(
to_html_with_options(
r###"_ foo bar_
"###,
&danger
)?,
r###"<p>_ foo bar_</p>
"###,
r###"Emphasis and strong emphasis (358)"###
);
assert_eq!(
to_html_with_options(
r###"a_"foo"_
"###,
&danger
)?,
r###"<p>a_&quot;foo&quot;_</p>
"###,
r###"Emphasis and strong emphasis (359)"###
);
assert_eq!(
to_html_with_options(
r###"foo_bar_
"###,
&danger
)?,
r###"<p>foo_bar_</p>
"###,
r###"Emphasis and strong emphasis (360)"###
);
assert_eq!(
to_html_with_options(
r###"5_6_78
"###,
&danger
)?,
r###"<p>5_6_78</p>
"###,
r###"Emphasis and strong emphasis (361)"###
);
assert_eq!(
to_html_with_options(
r###"пристаням_стремятся_
"###,
&danger
)?,
r###"<p>пристаням_стремятся_</p>
"###,
r###"Emphasis and strong emphasis (362)"###
);
assert_eq!(
to_html_with_options(
r###"aa_"bb"_cc
"###,
&danger
)?,
r###"<p>aa_&quot;bb&quot;_cc</p>
"###,
r###"Emphasis and strong emphasis (363)"###
);
assert_eq!(
to_html_with_options(
r###"foo-_(bar)_
"###,
&danger
)?,
r###"<p>foo-<em>(bar)</em></p>
"###,
r###"Emphasis and strong emphasis (364)"###
);
assert_eq!(
to_html_with_options(
r###"_foo*
"###,
&danger
)?,
r###"<p>_foo*</p>
"###,
r###"Emphasis and strong emphasis (365)"###
);
assert_eq!(
to_html_with_options(
r###"*foo bar *
"###,
&danger
)?,
r###"<p>*foo bar *</p>
"###,
r###"Emphasis and strong emphasis (366)"###
);
assert_eq!(
to_html_with_options(
r###"*foo bar
*
"###,
&danger
)?,
r###"<p>*foo bar
*</p>
"###,
r###"Emphasis and strong emphasis (367)"###
);
assert_eq!(
to_html_with_options(
r###"*(*foo)
"###,
&danger
)?,
r###"<p>*(*foo)</p>
"###,
r###"Emphasis and strong emphasis (368)"###
);
assert_eq!(
to_html_with_options(
r###"*(*foo*)*
"###,
&danger
)?,
r###"<p><em>(<em>foo</em>)</em></p>
"###,
r###"Emphasis and strong emphasis (369)"###
);
assert_eq!(
to_html_with_options(
r###"*foo*bar
"###,
&danger
)?,
r###"<p><em>foo</em>bar</p>
"###,
r###"Emphasis and strong emphasis (370)"###
);
assert_eq!(
to_html_with_options(
r###"_foo bar _
"###,
&danger
)?,
r###"<p>_foo bar _</p>
"###,
r###"Emphasis and strong emphasis (371)"###
);
assert_eq!(
to_html_with_options(
r###"_(_foo)
"###,
&danger
)?,
r###"<p>_(_foo)</p>
"###,
r###"Emphasis and strong emphasis (372)"###
);
assert_eq!(
to_html_with_options(
r###"_(_foo_)_
"###,
&danger
)?,
r###"<p><em>(<em>foo</em>)</em></p>
"###,
r###"Emphasis and strong emphasis (373)"###
);
assert_eq!(
to_html_with_options(
r###"_foo_bar
"###,
&danger
)?,
r###"<p>_foo_bar</p>
"###,
r###"Emphasis and strong emphasis (374)"###
);
assert_eq!(
to_html_with_options(
r###"_пристаням_стремятся
"###,
&danger
)?,
r###"<p>_пристаням_стремятся</p>
"###,
r###"Emphasis and strong emphasis (375)"###
);
assert_eq!(
to_html_with_options(
r###"_foo_bar_baz_
"###,
&danger
)?,
r###"<p><em>foo_bar_baz</em></p>
"###,
r###"Emphasis and strong emphasis (376)"###
);
assert_eq!(
to_html_with_options(
r###"_(bar)_.
"###,
&danger
)?,
r###"<p><em>(bar)</em>.</p>
"###,
r###"Emphasis and strong emphasis (377)"###
);
assert_eq!(
to_html_with_options(
r###"**foo bar**
"###,
&danger
)?,
r###"<p><strong>foo bar</strong></p>
"###,
r###"Emphasis and strong emphasis (378)"###
);
assert_eq!(
to_html_with_options(
r###"** foo bar**
"###,
&danger
)?,
r###"<p>** foo bar**</p>
"###,
r###"Emphasis and strong emphasis (379)"###
);
assert_eq!(
to_html_with_options(
r###"a**"foo"**
"###,
&danger
)?,
r###"<p>a**&quot;foo&quot;**</p>
"###,
r###"Emphasis and strong emphasis (380)"###
);
assert_eq!(
to_html_with_options(
r###"foo**bar**
"###,
&danger
)?,
r###"<p>foo<strong>bar</strong></p>
"###,
r###"Emphasis and strong emphasis (381)"###
);
assert_eq!(
to_html_with_options(
r###"__foo bar__
"###,
&danger
)?,
r###"<p><strong>foo bar</strong></p>
"###,
r###"Emphasis and strong emphasis (382)"###
);
assert_eq!(
to_html_with_options(
r###"__ foo bar__
"###,
&danger
)?,
r###"<p>__ foo bar__</p>
"###,
r###"Emphasis and strong emphasis (383)"###
);
assert_eq!(
to_html_with_options(
r###"__
foo bar__
"###,
&danger
)?,
r###"<p>__
foo bar__</p>
"###,
r###"Emphasis and strong emphasis (384)"###
);
assert_eq!(
to_html_with_options(
r###"a__"foo"__
"###,
&danger
)?,
r###"<p>a__&quot;foo&quot;__</p>
"###,
r###"Emphasis and strong emphasis (385)"###
);
assert_eq!(
to_html_with_options(
r###"foo__bar__
"###,
&danger
)?,
r###"<p>foo__bar__</p>
"###,
r###"Emphasis and strong emphasis (386)"###
);
assert_eq!(
to_html_with_options(
r###"5__6__78
"###,
&danger
)?,
r###"<p>5__6__78</p>
"###,
r###"Emphasis and strong emphasis (387)"###
);
assert_eq!(
to_html_with_options(
r###"пристаням__стремятся__
"###,
&danger
)?,
r###"<p>пристаням__стремятся__</p>
"###,
r###"Emphasis and strong emphasis (388)"###
);
assert_eq!(
to_html_with_options(
r###"__foo, __bar__, baz__
"###,
&danger
)?,
r###"<p><strong>foo, <strong>bar</strong>, baz</strong></p>
"###,
r###"Emphasis and strong emphasis (389)"###
);
assert_eq!(
to_html_with_options(
r###"foo-__(bar)__
"###,
&danger
)?,
r###"<p>foo-<strong>(bar)</strong></p>
"###,
r###"Emphasis and strong emphasis (390)"###
);
assert_eq!(
to_html_with_options(
r###"**foo bar **
"###,
&danger
)?,
r###"<p>**foo bar **</p>
"###,
r###"Emphasis and strong emphasis (391)"###
);
assert_eq!(
to_html_with_options(
r###"**(**foo)
"###,
&danger
)?,
r###"<p>**(**foo)</p>
"###,
r###"Emphasis and strong emphasis (392)"###
);
assert_eq!(
to_html_with_options(
r###"*(**foo**)*
"###,
&danger
)?,
r###"<p><em>(<strong>foo</strong>)</em></p>
"###,
r###"Emphasis and strong emphasis (393)"###
);
assert_eq!(
to_html_with_options(
r###"**Gomphocarpus (*Gomphocarpus physocarpus*, syn.
*Asclepias physocarpa*)**
"###,
&danger
)?,
r###"<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.
<em>Asclepias physocarpa</em>)</strong></p>
"###,
r###"Emphasis and strong emphasis (394)"###
);
assert_eq!(
to_html_with_options(
r###"**foo "*bar*" foo**
"###,
&danger
)?,
r###"<p><strong>foo &quot;<em>bar</em>&quot; foo</strong></p>
"###,
r###"Emphasis and strong emphasis (395)"###
);
assert_eq!(
to_html_with_options(
r###"**foo**bar
"###,
&danger
)?,
r###"<p><strong>foo</strong>bar</p>
"###,
r###"Emphasis and strong emphasis (396)"###
);
assert_eq!(
to_html_with_options(
r###"__foo bar __
"###,
&danger
)?,
r###"<p>__foo bar __</p>
"###,
r###"Emphasis and strong emphasis (397)"###
);
assert_eq!(
to_html_with_options(
r###"__(__foo)
"###,
&danger
)?,
r###"<p>__(__foo)</p>
"###,
r###"Emphasis and strong emphasis (398)"###
);
assert_eq!(
to_html_with_options(
r###"_(__foo__)_
"###,
&danger
)?,
r###"<p><em>(<strong>foo</strong>)</em></p>
"###,
r###"Emphasis and strong emphasis (399)"###
);
assert_eq!(
to_html_with_options(
r###"__foo__bar
"###,
&danger
)?,
r###"<p>__foo__bar</p>
"###,
r###"Emphasis and strong emphasis (400)"###
);
assert_eq!(
to_html_with_options(
r###"__пристаням__стремятся
"###,
&danger
)?,
r###"<p>__пристаням__стремятся</p>
"###,
r###"Emphasis and strong emphasis (401)"###
);
assert_eq!(
to_html_with_options(
r###"__foo__bar__baz__
"###,
&danger
)?,
r###"<p><strong>foo__bar__baz</strong></p>
"###,
r###"Emphasis and strong emphasis (402)"###
);
assert_eq!(
to_html_with_options(
r###"__(bar)__.
"###,
&danger
)?,
r###"<p><strong>(bar)</strong>.</p>
"###,
r###"Emphasis and strong emphasis (403)"###
);
assert_eq!(
to_html_with_options(
r###"*foo [bar](/url)*
"###,
&danger
)?,
r###"<p><em>foo <a href="/url">bar</a></em></p>
"###,
r###"Emphasis and strong emphasis (404)"###
);
assert_eq!(
to_html_with_options(
r###"*foo
bar*
"###,
&danger
)?,
r###"<p><em>foo
bar</em></p>
"###,
r###"Emphasis and strong emphasis (405)"###
);
assert_eq!(
to_html_with_options(
r###"_foo __bar__ baz_
"###,
&danger
)?,
r###"<p><em>foo <strong>bar</strong> baz</em></p>
"###,
r###"Emphasis and strong emphasis (406)"###
);
assert_eq!(
to_html_with_options(
r###"_foo _bar_ baz_
"###,
&danger
)?,
r###"<p><em>foo <em>bar</em> baz</em></p>
"###,
r###"Emphasis and strong emphasis (407)"###
);
assert_eq!(
to_html_with_options(
r###"__foo_ bar_
"###,
&danger
)?,
r###"<p><em><em>foo</em> bar</em></p>
"###,
r###"Emphasis and strong emphasis (408)"###
);
assert_eq!(
to_html_with_options(
r###"*foo *bar**
"###,
&danger
)?,
r###"<p><em>foo <em>bar</em></em></p>
"###,
r###"Emphasis and strong emphasis (409)"###
);
assert_eq!(
to_html_with_options(
r###"*foo **bar** baz*
"###,
&danger
)?,
r###"<p><em>foo <strong>bar</strong> baz</em></p>
"###,
r###"Emphasis and strong emphasis (410)"###
);
assert_eq!(
to_html_with_options(
r###"*foo**bar**baz*
"###,
&danger
)?,
r###"<p><em>foo<strong>bar</strong>baz</em></p>
"###,
r###"Emphasis and strong emphasis (411)"###
);
assert_eq!(
to_html_with_options(
r###"*foo**bar*
"###,
&danger
)?,
r###"<p><em>foo**bar</em></p>
"###,
r###"Emphasis and strong emphasis (412)"###
);
assert_eq!(
to_html_with_options(
r###"***foo** bar*
"###,
&danger
)?,
r###"<p><em><strong>foo</strong> bar</em></p>
"###,
r###"Emphasis and strong emphasis (413)"###
);
assert_eq!(
to_html_with_options(
r###"*foo **bar***
"###,
&danger
)?,
r###"<p><em>foo <strong>bar</strong></em></p>
"###,
r###"Emphasis and strong emphasis (414)"###
);
assert_eq!(
to_html_with_options(
r###"*foo**bar***
"###,
&danger
)?,
r###"<p><em>foo<strong>bar</strong></em></p>
"###,
r###"Emphasis and strong emphasis (415)"###
);
assert_eq!(
to_html_with_options(
r###"foo***bar***baz
"###,
&danger
)?,
r###"<p>foo<em><strong>bar</strong></em>baz</p>
"###,
r###"Emphasis and strong emphasis (416)"###
);
assert_eq!(
to_html_with_options(
r###"foo******bar*********baz
"###,
&danger
)?,
r###"<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p>
"###,
r###"Emphasis and strong emphasis (417)"###
);
assert_eq!(
to_html_with_options(
r###"*foo **bar *baz* bim** bop*
"###,
&danger
)?,
r###"<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p>
"###,
r###"Emphasis and strong emphasis (418)"###
);
assert_eq!(
to_html_with_options(
r###"*foo [*bar*](/url)*
"###,
&danger
)?,
r###"<p><em>foo <a href="/url"><em>bar</em></a></em></p>
"###,
r###"Emphasis and strong emphasis (419)"###
);
assert_eq!(
to_html_with_options(
r###"** is not an empty emphasis
"###,
&danger
)?,
r###"<p>** is not an empty emphasis</p>
"###,
r###"Emphasis and strong emphasis (420)"###
);
assert_eq!(
to_html_with_options(
r###"**** is not an empty strong emphasis
"###,
&danger
)?,
r###"<p>**** is not an empty strong emphasis</p>
"###,
r###"Emphasis and strong emphasis (421)"###
);
assert_eq!(
to_html_with_options(
r###"**foo [bar](/url)**
"###,
&danger
)?,
r###"<p><strong>foo <a href="/url">bar</a></strong></p>
"###,
r###"Emphasis and strong emphasis (422)"###
);
assert_eq!(
to_html_with_options(
r###"**foo
bar**
"###,
&danger
)?,
r###"<p><strong>foo
bar</strong></p>
"###,
r###"Emphasis and strong emphasis (423)"###
);
assert_eq!(
to_html_with_options(
r###"__foo _bar_ baz__
"###,
&danger
)?,
r###"<p><strong>foo <em>bar</em> baz</strong></p>
"###,
r###"Emphasis and strong emphasis (424)"###
);
assert_eq!(
to_html_with_options(
r###"__foo __bar__ baz__
"###,
&danger
)?,
r###"<p><strong>foo <strong>bar</strong> baz</strong></p>
"###,
r###"Emphasis and strong emphasis (425)"###
);
assert_eq!(
to_html_with_options(
r###"____foo__ bar__
"###,
&danger
)?,
r###"<p><strong><strong>foo</strong> bar</strong></p>
"###,
r###"Emphasis and strong emphasis (426)"###
);
assert_eq!(
to_html_with_options(
r###"**foo **bar****
"###,
&danger
)?,
r###"<p><strong>foo <strong>bar</strong></strong></p>
"###,
r###"Emphasis and strong emphasis (427)"###
);
assert_eq!(
to_html_with_options(
r###"**foo *bar* baz**
"###,
&danger
)?,
r###"<p><strong>foo <em>bar</em> baz</strong></p>
"###,
r###"Emphasis and strong emphasis (428)"###
);
assert_eq!(
to_html_with_options(
r###"**foo*bar*baz**
"###,
&danger
)?,
r###"<p><strong>foo<em>bar</em>baz</strong></p>
"###,
r###"Emphasis and strong emphasis (429)"###
);
assert_eq!(
to_html_with_options(
r###"***foo* bar**
"###,
&danger
)?,
r###"<p><strong><em>foo</em> bar</strong></p>
"###,
r###"Emphasis and strong emphasis (430)"###
);
assert_eq!(
to_html_with_options(
r###"**foo *bar***
"###,
&danger
)?,
r###"<p><strong>foo <em>bar</em></strong></p>
"###,
r###"Emphasis and strong emphasis (431)"###
);
assert_eq!(
to_html_with_options(
r###"**foo *bar **baz**
bim* bop**
"###,
&danger
)?,
r###"<p><strong>foo <em>bar <strong>baz</strong>
bim</em> bop</strong></p>
"###,
r###"Emphasis and strong emphasis (432)"###
);
assert_eq!(
to_html_with_options(
r###"**foo [*bar*](/url)**
"###,
&danger
)?,
r###"<p><strong>foo <a href="/url"><em>bar</em></a></strong></p>
"###,
r###"Emphasis and strong emphasis (433)"###
);
assert_eq!(
to_html_with_options(
r###"__ is not an empty emphasis
"###,
&danger
)?,
r###"<p>__ is not an empty emphasis</p>
"###,
r###"Emphasis and strong emphasis (434)"###
);
assert_eq!(
to_html_with_options(
r###"____ is not an empty strong emphasis
"###,
&danger
)?,
r###"<p>____ is not an empty strong emphasis</p>
"###,
r###"Emphasis and strong emphasis (435)"###
);
assert_eq!(
to_html_with_options(
r###"foo ***
"###,
&danger
)?,
r###"<p>foo ***</p>
"###,
r###"Emphasis and strong emphasis (436)"###
);
assert_eq!(
to_html_with_options(
r###"foo *\**
"###,
&danger
)?,
r###"<p>foo <em>*</em></p>
"###,
r###"Emphasis and strong emphasis (437)"###
);
assert_eq!(
to_html_with_options(
r###"foo *_*
"###,
&danger
)?,
r###"<p>foo <em>_</em></p>
"###,
r###"Emphasis and strong emphasis (438)"###
);
assert_eq!(
to_html_with_options(
r###"foo *****
"###,
&danger
)?,
r###"<p>foo *****</p>
"###,
r###"Emphasis and strong emphasis (439)"###
);
assert_eq!(
to_html_with_options(
r###"foo **\***
"###,
&danger
)?,
r###"<p>foo <strong>*</strong></p>
"###,
r###"Emphasis and strong emphasis (440)"###
);
assert_eq!(
to_html_with_options(
r###"foo **_**
"###,
&danger
)?,
r###"<p>foo <strong>_</strong></p>
"###,
r###"Emphasis and strong emphasis (441)"###
);
assert_eq!(
to_html_with_options(
r###"**foo*
"###,
&danger
)?,
r###"<p>*<em>foo</em></p>
"###,
r###"Emphasis and strong emphasis (442)"###
);
assert_eq!(
to_html_with_options(
r###"*foo**
"###,
&danger
)?,
r###"<p><em>foo</em>*</p>
"###,
r###"Emphasis and strong emphasis (443)"###
);
assert_eq!(
to_html_with_options(
r###"***foo**
"###,
&danger
)?,
r###"<p>*<strong>foo</strong></p>
"###,
r###"Emphasis and strong emphasis (444)"###
);
assert_eq!(
to_html_with_options(
r###"****foo*
"###,
&danger
)?,
r###"<p>***<em>foo</em></p>
"###,
r###"Emphasis and strong emphasis (445)"###
);
assert_eq!(
to_html_with_options(
r###"**foo***
"###,
&danger
)?,
r###"<p><strong>foo</strong>*</p>
"###,
r###"Emphasis and strong emphasis (446)"###
);
assert_eq!(
to_html_with_options(
r###"*foo****
"###,
&danger
)?,
r###"<p><em>foo</em>***</p>
"###,
r###"Emphasis and strong emphasis (447)"###
);
assert_eq!(
to_html_with_options(
r###"foo ___
"###,
&danger
)?,
r###"<p>foo ___</p>
"###,
r###"Emphasis and strong emphasis (448)"###
);
assert_eq!(
to_html_with_options(
r###"foo _\__
"###,
&danger
)?,
r###"<p>foo <em>_</em></p>
"###,
r###"Emphasis and strong emphasis (449)"###
);
assert_eq!(
to_html_with_options(
r###"foo _*_
"###,
&danger
)?,
r###"<p>foo <em>*</em></p>
"###,
r###"Emphasis and strong emphasis (450)"###
);
assert_eq!(
to_html_with_options(
r###"foo _____
"###,
&danger
)?,
r###"<p>foo _____</p>
"###,
r###"Emphasis and strong emphasis (451)"###
);
assert_eq!(
to_html_with_options(
r###"foo __\___
"###,
&danger
)?,
r###"<p>foo <strong>_</strong></p>
"###,
r###"Emphasis and strong emphasis (452)"###
);
assert_eq!(
to_html_with_options(
r###"foo __*__
"###,
&danger
)?,
r###"<p>foo <strong>*</strong></p>
"###,
r###"Emphasis and strong emphasis (453)"###
);
assert_eq!(
to_html_with_options(
r###"__foo_
"###,
&danger
)?,
r###"<p>_<em>foo</em></p>
"###,
r###"Emphasis and strong emphasis (454)"###
);
assert_eq!(
to_html_with_options(
r###"_foo__
"###,
&danger
)?,
r###"<p><em>foo</em>_</p>
"###,
r###"Emphasis and strong emphasis (455)"###
);
assert_eq!(
to_html_with_options(
r###"___foo__
"###,
&danger
)?,
r###"<p>_<strong>foo</strong></p>
"###,
r###"Emphasis and strong emphasis (456)"###
);
assert_eq!(
to_html_with_options(
r###"____foo_
"###,
&danger
)?,
r###"<p>___<em>foo</em></p>
"###,
r###"Emphasis and strong emphasis (457)"###
);
assert_eq!(
to_html_with_options(
r###"__foo___
"###,
&danger
)?,
r###"<p><strong>foo</strong>_</p>
"###,
r###"Emphasis and strong emphasis (458)"###
);
assert_eq!(
to_html_with_options(
r###"_foo____
"###,
&danger
)?,
r###"<p><em>foo</em>___</p>
"###,
r###"Emphasis and strong emphasis (459)"###
);
assert_eq!(
to_html_with_options(
r###"**foo**
"###,
&danger
)?,
r###"<p><strong>foo</strong></p>
"###,
r###"Emphasis and strong emphasis (460)"###
);
assert_eq!(
to_html_with_options(
r###"*_foo_*
"###,
&danger
)?,
r###"<p><em><em>foo</em></em></p>
"###,
r###"Emphasis and strong emphasis (461)"###
);
assert_eq!(
to_html_with_options(
r###"__foo__
"###,
&danger
)?,
r###"<p><strong>foo</strong></p>
"###,
r###"Emphasis and strong emphasis (462)"###
);
assert_eq!(
to_html_with_options(
r###"_*foo*_
"###,
&danger
)?,
r###"<p><em><em>foo</em></em></p>
"###,
r###"Emphasis and strong emphasis (463)"###
);
assert_eq!(
to_html_with_options(
r###"****foo****
"###,
&danger
)?,
r###"<p><strong><strong>foo</strong></strong></p>
"###,
r###"Emphasis and strong emphasis (464)"###
);
assert_eq!(
to_html_with_options(
r###"____foo____
"###,
&danger
)?,
r###"<p><strong><strong>foo</strong></strong></p>
"###,
r###"Emphasis and strong emphasis (465)"###
);
assert_eq!(
to_html_with_options(
r###"******foo******
"###,
&danger
)?,
r###"<p><strong><strong><strong>foo</strong></strong></strong></p>
"###,
r###"Emphasis and strong emphasis (466)"###
);
assert_eq!(
to_html_with_options(
r###"***foo***
"###,
&danger
)?,
r###"<p><em><strong>foo</strong></em></p>
"###,
r###"Emphasis and strong emphasis (467)"###
);
assert_eq!(
to_html_with_options(
r###"_____foo_____
"###,
&danger
)?,
r###"<p><em><strong><strong>foo</strong></strong></em></p>
"###,
r###"Emphasis and strong emphasis (468)"###
);
assert_eq!(
to_html_with_options(
r###"*foo _bar* baz_
"###,
&danger
)?,
r###"<p><em>foo _bar</em> baz_</p>
"###,
r###"Emphasis and strong emphasis (469)"###
);
assert_eq!(
to_html_with_options(
r###"*foo __bar *baz bim__ bam*
"###,
&danger
)?,
r###"<p><em>foo <strong>bar *baz bim</strong> bam</em></p>
"###,
r###"Emphasis and strong emphasis (470)"###
);
assert_eq!(
to_html_with_options(
r###"**foo **bar baz**
"###,
&danger
)?,
r###"<p>**foo <strong>bar baz</strong></p>
"###,
r###"Emphasis and strong emphasis (471)"###
);
assert_eq!(
to_html_with_options(
r###"*foo *bar baz*
"###,
&danger
)?,
r###"<p>*foo <em>bar baz</em></p>
"###,
r###"Emphasis and strong emphasis (472)"###
);
assert_eq!(
to_html_with_options(
r###"*[bar*](/url)
"###,
&danger
)?,
r###"<p>*<a href="/url">bar*</a></p>
"###,
r###"Emphasis and strong emphasis (473)"###
);
assert_eq!(
to_html_with_options(
r###"_foo [bar_](/url)
"###,
&danger
)?,
r###"<p>_foo <a href="/url">bar_</a></p>
"###,
r###"Emphasis and strong emphasis (474)"###
);
assert_eq!(
to_html_with_options(
r###"*<img src="foo" title="*"/>
"###,
&danger
)?,
r###"<p>*<img src="foo" title="*"/></p>
"###,
r###"Emphasis and strong emphasis (475)"###
);
assert_eq!(
to_html_with_options(
r###"**<a href="**">
"###,
&danger
)?,
r###"<p>**<a href="**"></p>
"###,
r###"Emphasis and strong emphasis (476)"###
);
assert_eq!(
to_html_with_options(
r###"__<a href="__">
"###,
&danger
)?,
r###"<p>__<a href="__"></p>
"###,
r###"Emphasis and strong emphasis (477)"###
);
assert_eq!(
to_html_with_options(
r###"*a `*`*
"###,
&danger
)?,
r###"<p><em>a <code>*</code></em></p>
"###,
r###"Emphasis and strong emphasis (478)"###
);
assert_eq!(
to_html_with_options(
r###"_a `_`_
"###,
&danger
)?,
r###"<p><em>a <code>_</code></em></p>
"###,
r###"Emphasis and strong emphasis (479)"###
);
assert_eq!(
to_html_with_options(
r###"**a<https://foo.bar/?q=**>
"###,
&danger
)?,
r###"<p>**a<a href="https://foo.bar/?q=**">https://foo.bar/?q=**</a></p>
"###,
r###"Emphasis and strong emphasis (480)"###
);
assert_eq!(
to_html_with_options(
r###"__a<https://foo.bar/?q=__>
"###,
&danger
)?,
r###"<p>__a<a href="https://foo.bar/?q=__">https://foo.bar/?q=__</a></p>
"###,
r###"Emphasis and strong emphasis (481)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/uri "title")
"###,
&danger
)?,
r###"<p><a href="/uri" title="title">link</a></p>
"###,
r###"Links (482)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/uri)
"###,
&danger
)?,
r###"<p><a href="/uri">link</a></p>
"###,
r###"Links (483)"###
);
assert_eq!(
to_html_with_options(
r###"[](./target.md)
"###,
&danger
)?,
r###"<p><a href="./target.md"></a></p>
"###,
r###"Links (484)"###
);
assert_eq!(
to_html_with_options(
r###"[link]()
"###,
&danger
)?,
r###"<p><a href="">link</a></p>
"###,
r###"Links (485)"###
);
assert_eq!(
to_html_with_options(
r###"[link](<>)
"###,
&danger
)?,
r###"<p><a href="">link</a></p>
"###,
r###"Links (486)"###
);
assert_eq!(
to_html_with_options(
r###"[]()
"###,
&danger
)?,
r###"<p><a href=""></a></p>
"###,
r###"Links (487)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/my uri)
"###,
&danger
)?,
r###"<p>[link](/my uri)</p>
"###,
r###"Links (488)"###
);
assert_eq!(
to_html_with_options(
r###"[link](</my uri>)
"###,
&danger
)?,
r###"<p><a href="/my%20uri">link</a></p>
"###,
r###"Links (489)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo
bar)
"###,
&danger
)?,
r###"<p>[link](foo
bar)</p>
"###,
r###"Links (490)"###
);
assert_eq!(
to_html_with_options(
r###"[link](<foo
bar>)
"###,
&danger
)?,
r###"<p>[link](<foo
bar>)</p>
"###,
r###"Links (491)"###
);
assert_eq!(
to_html_with_options(
r###"[a](<b)c>)
"###,
&danger
)?,
r###"<p><a href="b)c">a</a></p>
"###,
r###"Links (492)"###
);
assert_eq!(
to_html_with_options(
r###"[link](<foo\>)
"###,
&danger
)?,
r###"<p>[link](&lt;foo&gt;)</p>
"###,
r###"Links (493)"###
);
assert_eq!(
to_html_with_options(
r###"[a](<b)c
[a](<b)c>
[a](<b>c)
"###,
&danger
)?,
r###"<p>[a](&lt;b)c
[a](&lt;b)c&gt;
[a](<b>c)</p>
"###,
r###"Links (494)"###
);
assert_eq!(
to_html_with_options(
r###"[link](\(foo\))
"###,
&danger
)?,
r###"<p><a href="(foo)">link</a></p>
"###,
r###"Links (495)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo(and(bar)))
"###,
&danger
)?,
r###"<p><a href="foo(and(bar))">link</a></p>
"###,
r###"Links (496)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo(and(bar))
"###,
&danger
)?,
r###"<p>[link](foo(and(bar))</p>
"###,
r###"Links (497)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo\(and\(bar\))
"###,
&danger
)?,
r###"<p><a href="foo(and(bar)">link</a></p>
"###,
r###"Links (498)"###
);
assert_eq!(
to_html_with_options(
r###"[link](<foo(and(bar)>)
"###,
&danger
)?,
r###"<p><a href="foo(and(bar)">link</a></p>
"###,
r###"Links (499)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo\)\:)
"###,
&danger
)?,
r###"<p><a href="foo):">link</a></p>
"###,
r###"Links (500)"###
);
assert_eq!(
to_html_with_options(
r###"[link](#fragment)
[link](https://example.com#fragment)
[link](https://example.com?foo=3#frag)
"###,
&danger
)?,
r###"<p><a href="#fragment">link</a></p>
<p><a href="https://example.com#fragment">link</a></p>
<p><a href="https://example.com?foo=3#frag">link</a></p>
"###,
r###"Links (501)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo\bar)
"###,
&danger
)?,
r###"<p><a href="foo%5Cbar">link</a></p>
"###,
r###"Links (502)"###
);
assert_eq!(
to_html_with_options(
r###"[link](foo%20b&auml;)
"###,
&danger
)?,
r###"<p><a href="foo%20b%C3%A4">link</a></p>
"###,
r###"Links (503)"###
);
assert_eq!(
to_html_with_options(
r###"[link]("title")
"###,
&danger
)?,
r###"<p><a href="%22title%22">link</a></p>
"###,
r###"Links (504)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/url "title")
[link](/url 'title')
[link](/url (title))
"###,
&danger
)?,
r###"<p><a href="/url" title="title">link</a>
<a href="/url" title="title">link</a>
<a href="/url" title="title">link</a></p>
"###,
r###"Links (505)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/url "title \"&quot;")
"###,
&danger
)?,
r###"<p><a href="/url" title="title &quot;&quot;">link</a></p>
"###,
r###"Links (506)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/url "title")
"###,
&danger
)?,
r###"<p><a href="/url%C2%A0%22title%22">link</a></p>
"###,
r###"Links (507)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/url "title "and" title")
"###,
&danger
)?,
r###"<p>[link](/url &quot;title &quot;and&quot; title&quot;)</p>
"###,
r###"Links (508)"###
);
assert_eq!(
to_html_with_options(
r###"[link](/url 'title "and" title')
"###,
&danger
)?,
r###"<p><a href="/url" title="title &quot;and&quot; title">link</a></p>
"###,
r###"Links (509)"###
);
assert_eq!(
to_html_with_options(
r###"[link]( /uri
"title" )
"###,
&danger
)?,
r###"<p><a href="/uri" title="title">link</a></p>
"###,
r###"Links (510)"###
);
assert_eq!(
to_html_with_options(
r###"[link] (/uri)
"###,
&danger
)?,
r###"<p>[link] (/uri)</p>
"###,
r###"Links (511)"###
);
assert_eq!(
to_html_with_options(
r###"[link [foo [bar]]](/uri)
"###,
&danger
)?,
r###"<p><a href="/uri">link [foo [bar]]</a></p>
"###,
r###"Links (512)"###
);
assert_eq!(
to_html_with_options(
r###"[link] bar](/uri)
"###,
&danger
)?,
r###"<p>[link] bar](/uri)</p>
"###,
r###"Links (513)"###
);
assert_eq!(
to_html_with_options(
r###"[link [bar](/uri)
"###,
&danger
)?,
r###"<p>[link <a href="/uri">bar</a></p>
"###,
r###"Links (514)"###
);
assert_eq!(
to_html_with_options(
r###"[link \[bar](/uri)
"###,
&danger
)?,
r###"<p><a href="/uri">link [bar</a></p>
"###,
r###"Links (515)"###
);
assert_eq!(
to_html_with_options(
r###"[link *foo **bar** `#`*](/uri)
"###,
&danger
)?,
r###"<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
"###,
r###"Links (516)"###
);
assert_eq!(
to_html_with_options(
r###"[![moon](moon.jpg)](/uri)
"###,
&danger
)?,
r###"<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
"###,
r###"Links (517)"###
);
assert_eq!(
to_html_with_options(
r###"[foo [bar](/uri)](/uri)
"###,
&danger
)?,
r###"<p>[foo <a href="/uri">bar</a>](/uri)</p>
"###,
r###"Links (518)"###
);
assert_eq!(
to_html_with_options(
r###"[foo *[bar [baz](/uri)](/uri)*](/uri)
"###,
&danger
)?,
r###"<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p>
"###,
r###"Links (519)"###
);
assert_eq!(
to_html_with_options(
r###"![[[foo](uri1)](uri2)](uri3)
"###,
&danger
)?,
r###"<p><img src="uri3" alt="[foo](uri2)" /></p>
"###,
r###"Links (520)"###
);
assert_eq!(
to_html_with_options(
r###"*[foo*](/uri)
"###,
&danger
)?,
r###"<p>*<a href="/uri">foo*</a></p>
"###,
r###"Links (521)"###
);
assert_eq!(
to_html_with_options(
r###"[foo *bar](baz*)
"###,
&danger
)?,
r###"<p><a href="baz*">foo *bar</a></p>
"###,
r###"Links (522)"###
);
assert_eq!(
to_html_with_options(
r###"*foo [bar* baz]
"###,
&danger
)?,
r###"<p><em>foo [bar</em> baz]</p>
"###,
r###"Links (523)"###
);
assert_eq!(
to_html_with_options(
r###"[foo <bar attr="](baz)">
"###,
&danger
)?,
r###"<p>[foo <bar attr="](baz)"></p>
"###,
r###"Links (524)"###
);
assert_eq!(
to_html_with_options(
r###"[foo`](/uri)`
"###,
&danger
)?,
r###"<p>[foo<code>](/uri)</code></p>
"###,
r###"Links (525)"###
);
assert_eq!(
to_html_with_options(
r###"[foo<https://example.com/?search=](uri)>
"###,
&danger
)?,
r###"<p>[foo<a href="https://example.com/?search=%5D(uri)">https://example.com/?search=](uri)</a></p>
"###,
r###"Links (526)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][bar]
[bar]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">foo</a></p>
"###,
r###"Links (527)"###
);
assert_eq!(
to_html_with_options(
r###"[link [foo [bar]]][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p><a href="/uri">link [foo [bar]]</a></p>
"###,
r###"Links (528)"###
);
assert_eq!(
to_html_with_options(
r###"[link \[bar][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p><a href="/uri">link [bar</a></p>
"###,
r###"Links (529)"###
);
assert_eq!(
to_html_with_options(
r###"[link *foo **bar** `#`*][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
"###,
r###"Links (530)"###
);
assert_eq!(
to_html_with_options(
r###"[![moon](moon.jpg)][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
"###,
r###"Links (531)"###
);
assert_eq!(
to_html_with_options(
r###"[foo [bar](/uri)][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p>
"###,
r###"Links (532)"###
);
assert_eq!(
to_html_with_options(
r###"[foo *bar [baz][ref]*][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p>
"###,
r###"Links (533)"###
);
assert_eq!(
to_html_with_options(
r###"*[foo*][ref]
[ref]: /uri
"###,
&danger
)?,
r###"<p>*<a href="/uri">foo*</a></p>
"###,
r###"Links (534)"###
);
assert_eq!(
to_html_with_options(
r###"[foo *bar][ref]*
[ref]: /uri
"###,
&danger
)?,
r###"<p><a href="/uri">foo *bar</a>*</p>
"###,
r###"Links (535)"###
);
assert_eq!(
to_html_with_options(
r###"[foo <bar attr="][ref]">
[ref]: /uri
"###,
&danger
)?,
r###"<p>[foo <bar attr="][ref]"></p>
"###,
r###"Links (536)"###
);
assert_eq!(
to_html_with_options(
r###"[foo`][ref]`
[ref]: /uri
"###,
&danger
)?,
r###"<p>[foo<code>][ref]</code></p>
"###,
r###"Links (537)"###
);
assert_eq!(
to_html_with_options(
r###"[foo<https://example.com/?search=][ref]>
[ref]: /uri
"###,
&danger
)?,
r###"<p>[foo<a href="https://example.com/?search=%5D%5Bref%5D">https://example.com/?search=][ref]</a></p>
"###,
r###"Links (538)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][BaR]
[bar]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">foo</a></p>
"###,
r###"Links (539)"###
);
assert_eq!(
to_html_with_options(
r###"[ẞ]
[SS]: /url
"###,
&danger
)?,
r###"<p><a href="/url">ẞ</a></p>
"###,
r###"Links (540)"###
);
assert_eq!(
to_html_with_options(
r###"[Foo
bar]: /url
[Baz][Foo bar]
"###,
&danger
)?,
r###"<p><a href="/url">Baz</a></p>
"###,
r###"Links (541)"###
);
assert_eq!(
to_html_with_options(
r###"[foo] [bar]
[bar]: /url "title"
"###,
&danger
)?,
r###"<p>[foo] <a href="/url" title="title">bar</a></p>
"###,
r###"Links (542)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[bar]
[bar]: /url "title"
"###,
&danger
)?,
r###"<p>[foo]
<a href="/url" title="title">bar</a></p>
"###,
r###"Links (543)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]: /url1
[foo]: /url2
[bar][foo]
"###,
&danger
)?,
r###"<p><a href="/url1">bar</a></p>
"###,
r###"Links (544)"###
);
assert_eq!(
to_html_with_options(
r###"[bar][foo\!]
[foo!]: /url
"###,
&danger
)?,
r###"<p>[bar][foo!]</p>
"###,
r###"Links (545)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][ref[]
[ref[]: /uri
"###,
&danger
)?,
r###"<p>[foo][ref[]</p>
<p>[ref[]: /uri</p>
"###,
r###"Links (546)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][ref[bar]]
[ref[bar]]: /uri
"###,
&danger
)?,
r###"<p>[foo][ref[bar]]</p>
<p>[ref[bar]]: /uri</p>
"###,
r###"Links (547)"###
);
assert_eq!(
to_html_with_options(
r###"[[[foo]]]
[[[foo]]]: /url
"###,
&danger
)?,
r###"<p>[[[foo]]]</p>
<p>[[[foo]]]: /url</p>
"###,
r###"Links (548)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][ref\[]
[ref\[]: /uri
"###,
&danger
)?,
r###"<p><a href="/uri">foo</a></p>
"###,
r###"Links (549)"###
);
assert_eq!(
to_html_with_options(
r###"[bar\\]: /uri
[bar\\]
"###,
&danger
)?,
r###"<p><a href="/uri">bar\</a></p>
"###,
r###"Links (550)"###
);
assert_eq!(
to_html_with_options(
r###"[]
[]: /uri
"###,
&danger
)?,
r###"<p>[]</p>
<p>[]: /uri</p>
"###,
r###"Links (551)"###
);
assert_eq!(
to_html_with_options(
r###"[
]
[
]: /uri
"###,
&danger
)?,
r###"<p>[
]</p>
<p>[
]: /uri</p>
"###,
r###"Links (552)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">foo</a></p>
"###,
r###"Links (553)"###
);
assert_eq!(
to_html_with_options(
r###"[*foo* bar][]
[*foo* bar]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title"><em>foo</em> bar</a></p>
"###,
r###"Links (554)"###
);
assert_eq!(
to_html_with_options(
r###"[Foo][]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">Foo</a></p>
"###,
r###"Links (555)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">foo</a>
[]</p>
"###,
r###"Links (556)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">foo</a></p>
"###,
r###"Links (557)"###
);
assert_eq!(
to_html_with_options(
r###"[*foo* bar]
[*foo* bar]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title"><em>foo</em> bar</a></p>
"###,
r###"Links (558)"###
);
assert_eq!(
to_html_with_options(
r###"[[*foo* bar]]
[*foo* bar]: /url "title"
"###,
&danger
)?,
r###"<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p>
"###,
r###"Links (559)"###
);
assert_eq!(
to_html_with_options(
r###"[[bar [foo]
[foo]: /url
"###,
&danger
)?,
r###"<p>[[bar <a href="/url">foo</a></p>
"###,
r###"Links (560)"###
);
assert_eq!(
to_html_with_options(
r###"[Foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><a href="/url" title="title">Foo</a></p>
"###,
r###"Links (561)"###
);
assert_eq!(
to_html_with_options(
r###"[foo] bar
[foo]: /url
"###,
&danger
)?,
r###"<p><a href="/url">foo</a> bar</p>
"###,
r###"Links (562)"###
);
assert_eq!(
to_html_with_options(
r###"\[foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p>[foo]</p>
"###,
r###"Links (563)"###
);
assert_eq!(
to_html_with_options(
r###"[foo*]: /url
*[foo*]
"###,
&danger
)?,
r###"<p>*<a href="/url">foo*</a></p>
"###,
r###"Links (564)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][bar]
[foo]: /url1
[bar]: /url2
"###,
&danger
)?,
r###"<p><a href="/url2">foo</a></p>
"###,
r###"Links (565)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][]
[foo]: /url1
"###,
&danger
)?,
r###"<p><a href="/url1">foo</a></p>
"###,
r###"Links (566)"###
);
assert_eq!(
to_html_with_options(
r###"[foo]()
[foo]: /url1
"###,
&danger
)?,
r###"<p><a href="">foo</a></p>
"###,
r###"Links (567)"###
);
assert_eq!(
to_html_with_options(
r###"[foo](not a link)
[foo]: /url1
"###,
&danger
)?,
r###"<p><a href="/url1">foo</a>(not a link)</p>
"###,
r###"Links (568)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][bar][baz]
[baz]: /url
"###,
&danger
)?,
r###"<p>[foo]<a href="/url">bar</a></p>
"###,
r###"Links (569)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][bar][baz]
[baz]: /url1
[bar]: /url2
"###,
&danger
)?,
r###"<p><a href="/url2">foo</a><a href="/url1">baz</a></p>
"###,
r###"Links (570)"###
);
assert_eq!(
to_html_with_options(
r###"[foo][bar][baz]
[baz]: /url1
[foo]: /url2
"###,
&danger
)?,
r###"<p>[foo]<a href="/url1">bar</a></p>
"###,
r###"Links (571)"###
);
assert_eq!(
to_html_with_options(
r###"![foo](/url "title")
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo" title="title" /></p>
"###,
r###"Images (572)"###
);
assert_eq!(
to_html_with_options(
r###"![foo *bar*]
[foo *bar*]: train.jpg "train & tracks"
"###,
&danger
)?,
r###"<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
"###,
r###"Images (573)"###
);
assert_eq!(
to_html_with_options(
r###"![foo ![bar](/url)](/url2)
"###,
&danger
)?,
r###"<p><img src="/url2" alt="foo bar" /></p>
"###,
r###"Images (574)"###
);
assert_eq!(
to_html_with_options(
r###"![foo [bar](/url)](/url2)
"###,
&danger
)?,
r###"<p><img src="/url2" alt="foo bar" /></p>
"###,
r###"Images (575)"###
);
assert_eq!(
to_html_with_options(
r###"![foo *bar*][]
[foo *bar*]: train.jpg "train & tracks"
"###,
&danger
)?,
r###"<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
"###,
r###"Images (576)"###
);
assert_eq!(
to_html_with_options(
r###"![foo *bar*][foobar]
[FOOBAR]: train.jpg "train & tracks"
"###,
&danger
)?,
r###"<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
"###,
r###"Images (577)"###
);
assert_eq!(
to_html_with_options(
r###"![foo](train.jpg)
"###,
&danger
)?,
r###"<p><img src="train.jpg" alt="foo" /></p>
"###,
r###"Images (578)"###
);
assert_eq!(
to_html_with_options(
r###"My ![foo bar](/path/to/train.jpg "title" )
"###,
&danger
)?,
r###"<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p>
"###,
r###"Images (579)"###
);
assert_eq!(
to_html_with_options(
r###"![foo](<url>)
"###,
&danger
)?,
r###"<p><img src="url" alt="foo" /></p>
"###,
r###"Images (580)"###
);
assert_eq!(
to_html_with_options(
r###"![](/url)
"###,
&danger
)?,
r###"<p><img src="/url" alt="" /></p>
"###,
r###"Images (581)"###
);
assert_eq!(
to_html_with_options(
r###"![foo][bar]
[bar]: /url
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo" /></p>
"###,
r###"Images (582)"###
);
assert_eq!(
to_html_with_options(
r###"![foo][bar]
[BAR]: /url
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo" /></p>
"###,
r###"Images (583)"###
);
assert_eq!(
to_html_with_options(
r###"![foo][]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo" title="title" /></p>
"###,
r###"Images (584)"###
);
assert_eq!(
to_html_with_options(
r###"![*foo* bar][]
[*foo* bar]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo bar" title="title" /></p>
"###,
r###"Images (585)"###
);
assert_eq!(
to_html_with_options(
r###"![Foo][]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="Foo" title="title" /></p>
"###,
r###"Images (586)"###
);
assert_eq!(
to_html_with_options(
r###"![foo]
[]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo" title="title" />
[]</p>
"###,
r###"Images (587)"###
);
assert_eq!(
to_html_with_options(
r###"![foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo" title="title" /></p>
"###,
r###"Images (588)"###
);
assert_eq!(
to_html_with_options(
r###"![*foo* bar]
[*foo* bar]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="foo bar" title="title" /></p>
"###,
r###"Images (589)"###
);
assert_eq!(
to_html_with_options(
r###"![[foo]]
[[foo]]: /url "title"
"###,
&danger
)?,
r###"<p>![[foo]]</p>
<p>[[foo]]: /url &quot;title&quot;</p>
"###,
r###"Images (590)"###
);
assert_eq!(
to_html_with_options(
r###"![Foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p><img src="/url" alt="Foo" title="title" /></p>
"###,
r###"Images (591)"###
);
assert_eq!(
to_html_with_options(
r###"!\[foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p>![foo]</p>
"###,
r###"Images (592)"###
);
assert_eq!(
to_html_with_options(
r###"\![foo]
[foo]: /url "title"
"###,
&danger
)?,
r###"<p>!<a href="/url" title="title">foo</a></p>
"###,
r###"Images (593)"###
);
assert_eq!(
to_html_with_options(
r###"<http://foo.bar.baz>
"###,
&danger
)?,
r###"<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p>
"###,
r###"Autolinks (594)"###
);
assert_eq!(
to_html_with_options(
r###"<https://foo.bar.baz/test?q=hello&id=22&boolean>
"###,
&danger
)?,
r###"<p><a href="https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p>
"###,
r###"Autolinks (595)"###
);
assert_eq!(
to_html_with_options(
r###"<irc://foo.bar:2233/baz>
"###,
&danger
)?,
r###"<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p>
"###,
r###"Autolinks (596)"###
);
assert_eq!(
to_html_with_options(
r###"<MAILTO:FOO@BAR.BAZ>
"###,
&danger
)?,
r###"<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>
"###,
r###"Autolinks (597)"###
);
assert_eq!(
to_html_with_options(
r###"<a+b+c:d>
"###,
&danger
)?,
r###"<p><a href="a+b+c:d">a+b+c:d</a></p>
"###,
r###"Autolinks (598)"###
);
assert_eq!(
to_html_with_options(
r###"<made-up-scheme://foo,bar>
"###,
&danger
)?,
r###"<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>
"###,
r###"Autolinks (599)"###
);
assert_eq!(
to_html_with_options(
r###"<https://../>
"###,
&danger
)?,
r###"<p><a href="https://../">https://../</a></p>
"###,
r###"Autolinks (600)"###
);
assert_eq!(
to_html_with_options(
r###"<localhost:5001/foo>
"###,
&danger
)?,
r###"<p><a href="localhost:5001/foo">localhost:5001/foo</a></p>
"###,
r###"Autolinks (601)"###
);
assert_eq!(
to_html_with_options(
r###"<https://foo.bar/baz bim>
"###,
&danger
)?,
r###"<p>&lt;https://foo.bar/baz bim&gt;</p>
"###,
r###"Autolinks (602)"###
);
assert_eq!(
to_html_with_options(
r###"<https://example.com/\[\>
"###,
&danger
)?,
r###"<p><a href="https://example.com/%5C%5B%5C">https://example.com/\[\</a></p>
"###,
r###"Autolinks (603)"###
);
assert_eq!(
to_html_with_options(
r###"<foo@bar.example.com>
"###,
&danger
)?,
r###"<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p>
"###,
r###"Autolinks (604)"###
);
assert_eq!(
to_html_with_options(
r###"<foo+special@Bar.baz-bar0.com>
"###,
&danger
)?,
r###"<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p>
"###,
r###"Autolinks (605)"###
);
assert_eq!(
to_html_with_options(
r###"<foo\+@bar.example.com>
"###,
&danger
)?,
r###"<p>&lt;foo+@bar.example.com&gt;</p>
"###,
r###"Autolinks (606)"###
);
assert_eq!(
to_html_with_options(
r###"<>
"###,
&danger
)?,
r###"<p>&lt;&gt;</p>
"###,
r###"Autolinks (607)"###
);
assert_eq!(
to_html_with_options(
r###"< https://foo.bar >
"###,
&danger
)?,
r###"<p>&lt; https://foo.bar &gt;</p>
"###,
r###"Autolinks (608)"###
);
assert_eq!(
to_html_with_options(
r###"<m:abc>
"###,
&danger
)?,
r###"<p>&lt;m:abc&gt;</p>
"###,
r###"Autolinks (609)"###
);
assert_eq!(
to_html_with_options(
r###"<foo.bar.baz>
"###,
&danger
)?,
r###"<p>&lt;foo.bar.baz&gt;</p>
"###,
r###"Autolinks (610)"###
);
assert_eq!(
to_html_with_options(
r###"https://example.com
"###,
&danger
)?,
r###"<p>https://example.com</p>
"###,
r###"Autolinks (611)"###
);
assert_eq!(
to_html_with_options(
r###"foo@bar.example.com
"###,
&danger
)?,
r###"<p>foo@bar.example.com</p>
"###,
r###"Autolinks (612)"###
);
assert_eq!(
to_html_with_options(
r###"<a><bab><c2c>
"###,
&danger
)?,
r###"<p><a><bab><c2c></p>
"###,
r###"Raw HTML (613)"###
);
assert_eq!(
to_html_with_options(
r###"<a/><b2/>
"###,
&danger
)?,
r###"<p><a/><b2/></p>
"###,
r###"Raw HTML (614)"###
);
assert_eq!(
to_html_with_options(
r###"<a /><b2
data="foo" >
"###,
&danger
)?,
r###"<p><a /><b2
data="foo" ></p>
"###,
r###"Raw HTML (615)"###
);
assert_eq!(
to_html_with_options(
r###"<a foo="bar" bam = 'baz <em>"</em>'
_boolean zoop:33=zoop:33 />
"###,
&danger
)?,
r###"<p><a foo="bar" bam = 'baz <em>"</em>'
_boolean zoop:33=zoop:33 /></p>
"###,
r###"Raw HTML (616)"###
);
assert_eq!(
to_html_with_options(
r###"Foo <responsive-image src="foo.jpg" />
"###,
&danger
)?,
r###"<p>Foo <responsive-image src="foo.jpg" /></p>
"###,
r###"Raw HTML (617)"###
);
assert_eq!(
to_html_with_options(
r###"<33> <__>
"###,
&danger
)?,
r###"<p>&lt;33&gt; &lt;__&gt;</p>
"###,
r###"Raw HTML (618)"###
);
assert_eq!(
to_html_with_options(
r###"<a h*#ref="hi">
"###,
&danger
)?,
r###"<p>&lt;a h*#ref=&quot;hi&quot;&gt;</p>
"###,
r###"Raw HTML (619)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="hi'> <a href=hi'>
"###,
&danger
)?,
r###"<p>&lt;a href=&quot;hi'&gt; &lt;a href=hi'&gt;</p>
"###,
r###"Raw HTML (620)"###
);
assert_eq!(
to_html_with_options(
r###"< a><
foo><bar/ >
<foo bar=baz
bim!bop />
"###,
&danger
)?,
r###"<p>&lt; a&gt;&lt;
foo&gt;&lt;bar/ &gt;
&lt;foo bar=baz
bim!bop /&gt;</p>
"###,
r###"Raw HTML (621)"###
);
assert_eq!(
to_html_with_options(
r###"<a href='bar'title=title>
"###,
&danger
)?,
r###"<p>&lt;a href='bar'title=title&gt;</p>
"###,
r###"Raw HTML (622)"###
);
assert_eq!(
to_html_with_options(
r###"</a></foo >
"###,
&danger
)?,
r###"<p></a></foo ></p>
"###,
r###"Raw HTML (623)"###
);
assert_eq!(
to_html_with_options(
r###"</a href="foo">
"###,
&danger
)?,
r###"<p>&lt;/a href=&quot;foo&quot;&gt;</p>
"###,
r###"Raw HTML (624)"###
);
assert_eq!(
to_html_with_options(
r###"foo <!-- this is a --
comment - with hyphens -->
"###,
&danger
)?,
r###"<p>foo <!-- this is a --
comment - with hyphens --></p>
"###,
r###"Raw HTML (625)"###
);
assert_eq!(
to_html_with_options(
r###"foo <!--> foo -->
foo <!---> foo -->
"###,
&danger
)?,
r###"<p>foo <!--> foo --&gt;</p>
<p>foo <!---> foo --&gt;</p>
"###,
r###"Raw HTML (626)"###
);
assert_eq!(
to_html_with_options(
r###"foo <?php echo $a; ?>
"###,
&danger
)?,
r###"<p>foo <?php echo $a; ?></p>
"###,
r###"Raw HTML (627)"###
);
assert_eq!(
to_html_with_options(
r###"foo <!ELEMENT br EMPTY>
"###,
&danger
)?,
r###"<p>foo <!ELEMENT br EMPTY></p>
"###,
r###"Raw HTML (628)"###
);
assert_eq!(
to_html_with_options(
r###"foo <![CDATA[>&<]]>
"###,
&danger
)?,
r###"<p>foo <![CDATA[>&<]]></p>
"###,
r###"Raw HTML (629)"###
);
assert_eq!(
to_html_with_options(
r###"foo <a href="&ouml;">
"###,
&danger
)?,
r###"<p>foo <a href="&ouml;"></p>
"###,
r###"Raw HTML (630)"###
);
assert_eq!(
to_html_with_options(
r###"foo <a href="\*">
"###,
&danger
)?,
r###"<p>foo <a href="\*"></p>
"###,
r###"Raw HTML (631)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="\"">
"###,
&danger
)?,
r###"<p>&lt;a href=&quot;&quot;&quot;&gt;</p>
"###,
r###"Raw HTML (632)"###
);
assert_eq!(
to_html_with_options(
r###"foo
baz
"###,
&danger
)?,
r###"<p>foo<br />
baz</p>
"###,
r###"Hard line breaks (633)"###
);
assert_eq!(
to_html_with_options(
r###"foo\
baz
"###,
&danger
)?,
r###"<p>foo<br />
baz</p>
"###,
r###"Hard line breaks (634)"###
);
assert_eq!(
to_html_with_options(
r###"foo
baz
"###,
&danger
)?,
r###"<p>foo<br />
baz</p>
"###,
r###"Hard line breaks (635)"###
);
assert_eq!(
to_html_with_options(
r###"foo
bar
"###,
&danger
)?,
r###"<p>foo<br />
bar</p>
"###,
r###"Hard line breaks (636)"###
);
assert_eq!(
to_html_with_options(
r###"foo\
bar
"###,
&danger
)?,
r###"<p>foo<br />
bar</p>
"###,
r###"Hard line breaks (637)"###
);
assert_eq!(
to_html_with_options(
r###"*foo
bar*
"###,
&danger
)?,
r###"<p><em>foo<br />
bar</em></p>
"###,
r###"Hard line breaks (638)"###
);
assert_eq!(
to_html_with_options(
r###"*foo\
bar*
"###,
&danger
)?,
r###"<p><em>foo<br />
bar</em></p>
"###,
r###"Hard line breaks (639)"###
);
assert_eq!(
to_html_with_options(
r###"`code
span`
"###,
&danger
)?,
r###"<p><code>code span</code></p>
"###,
r###"Hard line breaks (640)"###
);
assert_eq!(
to_html_with_options(
r###"`code\
span`
"###,
&danger
)?,
r###"<p><code>code\ span</code></p>
"###,
r###"Hard line breaks (641)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="foo
bar">
"###,
&danger
)?,
r###"<p><a href="foo
bar"></p>
"###,
r###"Hard line breaks (642)"###
);
assert_eq!(
to_html_with_options(
r###"<a href="foo\
bar">
"###,
&danger
)?,
r###"<p><a href="foo\
bar"></p>
"###,
r###"Hard line breaks (643)"###
);
assert_eq!(
to_html_with_options(
r###"foo\
"###,
&danger
)?,
r###"<p>foo\</p>
"###,
r###"Hard line breaks (644)"###
);
assert_eq!(
to_html_with_options(
r###"foo
"###,
&danger
)?,
r###"<p>foo</p>
"###,
r###"Hard line breaks (645)"###
);
assert_eq!(
to_html_with_options(
r###"### foo\
"###,
&danger
)?,
r###"<h3>foo\</h3>
"###,
r###"Hard line breaks (646)"###
);
assert_eq!(
to_html_with_options(
r###"### foo
"###,
&danger
)?,
r###"<h3>foo</h3>
"###,
r###"Hard line breaks (647)"###
);
assert_eq!(
to_html_with_options(
r###"foo
baz
"###,
&danger
)?,
r###"<p>foo
baz</p>
"###,
r###"Soft line breaks (648)"###
);
assert_eq!(
to_html_with_options(
r###"foo
baz
"###,
&danger
)?,
r###"<p>foo
baz</p>
"###,
r###"Soft line breaks (649)"###
);
assert_eq!(
to_html_with_options(
r###"hello $.;'there
"###,
&danger
)?,
r###"<p>hello $.;'there</p>
"###,
r###"Textual content (650)"###
);
assert_eq!(
to_html_with_options(
r###"Foo χρῆν
"###,
&danger
)?,
r###"<p>Foo χρῆν</p>
"###,
r###"Textual content (651)"###
);
assert_eq!(
to_html_with_options(
r###"Multiple spaces
"###,
&danger
)?,
r###"<p>Multiple spaces</p>
"###,
r###"Textual content (652)"###
);
Ok(())
}