// This file is auto-generated by the build script // Please, do not modify it manually use super::test_markdown_html; #[test] fn math_test_1() { let original = r##"This sentence uses `$` delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$ $\sum_{k=1}^n a_k b_k$: Mathematical expression at head of line `\` may follow just after the first `$`: $\{1, 2, 3\}$ "##; let expected = r##"

This sentence uses $ delimiters to show math inline: \sqrt{3x-1}+(1+x)^2 \sum_{k=1}^n a_k b_k: Mathematical expression at head of line

\ may follow just after the first $: \{1, 2, 3\}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_2() { let original = r##"**The Cauchy-Schwarz Inequality** $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$ "##; let expected = r##"

The Cauchy-Schwarz Inequality

\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_3() { let original = r##"Oops empty $$ expression. $$$$ "##; let expected = r##"

Oops empty $$ expression.

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_4() { let original = r##"$x$$$$$$$y$$ $x$$$$$$y$$ $$x$$$$$$y$$ "##; let expected = r##"

xy

xy$

xy$$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_5() { let original = r##"$ac$ $${a*b*c} _c_ d$$ $not `code`$ $![not an](/image)$ $$ $α$ "##; let expected = r##"

a<b>c</b>

{a*b*c} _c_ d

not `code`

![not an](/image)

<https://not.a.link/>

&alpha;

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_6() { let original = r##"Hello $world. Dollar at end of line$ "##; let expected = r##"

Hello $world.

Dollar at end of line$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_7() { let original = r##"$5x + 2 = 17$ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$ "##; let expected = r##"

5x + 2 = 17

\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_8() { let original = r##"$not a\ hard break either$ "##; let expected = r##"

not a\ hard break either

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_9() { let original = r##"$\$$ $$y = \$ x$$ "##; let expected = r##"

\$

y = \$ x

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_10() { let original = r##"$x $ x$ $$ $ $$ "##; let expected = r##"

$x $ x$

$$ $ $$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_11() { let original = r##"alpha$$beta$gamma$$delta "##; let expected = r##"

alpha$betagamma$$delta

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_12() { let original = r##"these are not math texts: $ y=x$, $y=x $, $ y=x$ and $y=x $ >The start of a line counts as whitespace $2 + >$ While displays can start with whitespace, {${ they should not allow inlines to do that $$2 + $*$ "##; let expected = r##"

these are not math texts: $ y=x$, $y=x $, $ y=x$ and $y=x $

The start of a line counts as whitespace $2 + $

While displays can start with whitespace, {${ they should not allow inlines to do that $$2 + *

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_13() { let original = r##"these are math texts: foo$y=x$bar and $y=x$bar and foo$y=x$ bar "##; let expected = r##"

these are math texts: fooy=xbar and y=xbar and fooy=x bar

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_14() { let original = r##"math texts: $x=y$! and $x=y$? and $x=y$: and $x=y$. and $x=y$" also math texts: !$x=y$! and ?$x=y$? and :$x=y$: and .$x=y$. and "$x=y$" braces: ($x=y$) [$x=y$] {$x=y$} "##; let expected = r##"

math texts: x=y! and x=y? and x=y: and x=y. and x=y"

also math texts: !x=y! and ?x=y? and :x=y: and .x=y. and "x=y"

braces: (x=y) [x=y] {x=y}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_15() { let original = r##"$x=y$ "##; let expected = r##"

x=y

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_16() { let original = r##"$a$$b$ $a$$$b$$ $$a$$$b$ $$a$$$$b$$ "##; let expected = r##"

ab

ab

ab

ab

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_17() { let original = r##"$Inline `first$ then` code `Code $first` then$ inline $$ Display `first $$ then` code `Code $$ first` then $$ display "##; let expected = r##"

Inline `first then` code

Code $first then$ inline

Display `first then` code

Code $$ first then $$ display

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_18() { let original = r##"$x + y - z$ $x + y - z$ $$ x + y > z $$ "##; let expected = r##"

x + y - z

$x + y

$$ x + y

z $$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_19() { let original = r##"$not math$ $$ not math $$ "##; let expected = r##"

$not

math$

$$ not

math $$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_20() { let original = r##"- $not - * math$ "##; let expected = r##" "##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_21() { let original = r##"This is display math: $$ \text{Hello $x^2$} $$ And this is inline math: $\text{Hello $x$ there!}$ "##; let expected = r##"

This is display math: \text{Hello $x^2$} And this is inline math: \text{Hello $x$ there!}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_22() { let original = r##"This is not valid math: $}{$ Neither is this: { $}{$ } This is: $\}\{$ This is: $\}$ Math environment contains 2+2: $}$2+2$ Math environment contains y: $x {$ $ } $y$ "##; let expected = r##"

This is not valid math: $}{$

Neither is this: { $}{$ }

This is: \}\{

This is: \}

Math environment contains 2+2: $}2+2

Math environment contains y: $x {$ $ } y

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_23() { let original = r##"This is not display math. It is inline math: $$\text{first $$ second}$ $$$\text{first $$ second}$ This is display math: $$\text{first $$ second}$$ $$$\text{first $$ second}$$ This is also display math, but (counterintuitively) it's allowed to be empty and expected to be as short as possible: $$$$\text{first $$ second}$$ "##; let expected = r##"

This is not display math. It is inline math:

$\text{first $$ second}

$$\text{first $$ second}

This is display math:

\text{first $$ second}

$\text{first $$ second}

This is also display math, but (counterintuitively) it's allowed to be empty and expected to be as short as possible:

\text{first $$ second}$$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_24() { let original = r##"$\text{\$}$ $$x$x$$ ${$^$$ $}$$$$ $}$] $$ "##; let expected = r##"

\text{\$}

$xx$$

${^$

$}

$}$] $$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_25() { let original = r##"$x$ $`y`$ "##; let expected = r##"

x `y`

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_26() { let original = r##"- $a$ ```math a ``` $$ a $$ - ```math b ``` $$ b $$ "##; let expected = r##" "##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_27() { let original = r##"- ![node logo](https://nodejs.org/static/images/logo.svg) - $x$ "##; let expected = r##" "##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_28() { let original = r##"
$A = 5$ $$ A = 5 $$
"##; let expected = r##"

A = 5

A = 5

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_29() { let original = r##"$aa<b

a<b

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_30() { let original = r##"[^a] [^a]: Lorem $a$ "##; let expected = r##"

1

1

Lorem a

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_31() { let original = r##"[$a$](x) "##; let expected = r##"

a

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_32() { let original = r##"a$x$ -$x$ 1$x$ "##; let expected = r##"

ax

-x

1x

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_33() { let original = r##"_$a$ equals $b$_ _$a$ equals $b$_ **$a$ equals $b$** "##; let expected = r##"

a equals b

a equals b

a equals b

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_34() { let original = r##"$$ a $$ - $$ \text{$b$} $$ "##; let expected = r##"

a

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_35() { let original = r##"$\{a\,b\}$ "##; let expected = r##"

\{a\,b\}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_36() { let original = r##"$a c$ $[(a+b)c](d+e)$ ${a}_b c_{d}$ "##; let expected = r##"

a <b > c

[(a+b)c](d+e)

{a}_b c_{d}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_37() { let original = r##"When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ "##; let expected = r##"

When a \ne 0, there are two solutions to (ax^2 + bx + c = 0) and they are x = {-b \pm \sqrt{b^2-4ac} \over 2a}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_38() { let original = r##"$x = \$$ "##; let expected = r##"

x = \$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_39() { let original = r##"_Equation $\Omega(69)$ in italic text_ "##; let expected = r##"

Equation \Omega(69) in italic text

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_40() { let original = r##"$\pi$ '$\pi$ "$\pi$ ($\pi$ [$\pi$ {$\pi$ /$\pi$ "##; let expected = r##"

\pi '\pi "\pi (\pi [\pi {\pi /\pi

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_41() { let original = r##"| first $|$ second | |--------|---------| | a ${ | }$ b | "##; let expected = r##"
first $$ second
a ${}$ b
"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_42() { let original = r##"| first $\|$ second | |-------------------| | a ${ \| }$ b | "##; let expected = r##"
first | second
a { | } b
"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_43() { let original = r##"| Description | Test case | |-------------|-----------| | Single | $\$ | | Double | $\\$ | | Basic test | $\|$ | | Basic test 2| $\|\|\$ | | Basic test 3| $x\|y\|z\$| | Not pipe | $\.$ | | Combo | $\.\|$ | | Combo 2 | $\.\|\$ | | Extra | $\\\.$ | | Wait, what? | $\\|$ | | Wait, what? | $\\\|$ | | Wait, what? | $\\\\|$ | | Wait, what? | $\\\\\|$ | "##; let expected = r##"
DescriptionTest case
Single$$
Double\\
Basic test|
Basic test 2$||$
Basic test 3$x|y|z$
Not pipe\.
Combo\.|
Combo 2$.|$
Extra\\\.
Wait, what?\|
Wait, what?\\|
Wait, what?\\\|
Wait, what?\\\\|
"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_44() { let original = r##"This is not an inline math environment: $}{$ But, because it's nested too deeply, this is parsed as an inline math environment: {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ improperly $}{$ nested }}}}}}}}}}}}}}}}}}}}}}}}}}}}}} But this still isn't, because the braces are still counted: $}{$ "##; let expected = r##"

This is not an inline math environment: $}{$ But, because it's nested too deeply, this is parsed as an inline math environment: {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ improperly }{ nested }}}}}}}}}}}}}}}}}}}}}}}}}}}}}} But this still isn't, because the braces are still counted: $}{$

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_45() { let original = r##"This is also deeply nested, but, unlike the first example, they don't have an equal number of close braces and open braces, so aren't detected as math. {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ improperly $}$ nested ${$ example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}} This, however, is detected ${}$ ${{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ another improperly nested example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}$ "##; let expected = r##"

This is also deeply nested, but, unlike the first example, they don't have an equal number of close braces and open braces, so aren't detected as math. {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ improperly $}$ nested ${$ example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}} This, however, is detected {}

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ another improperly nested example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_46() { let original = r##"${}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 20 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 40 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 60 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 80 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 100 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 120 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 140 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 160 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 180 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 200 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 220 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 240 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{$ 255 brace pairs and one unclosed brace "##; let expected = r##"

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 20 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 40 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 60 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 80 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 100 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 120 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 140 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 160 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 180 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 200 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 220 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 240 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{ 255 brace pairs and one unclosed brace

"##; test_markdown_html(original, expected, false, false, false); } #[test] fn math_test_47() { let original = r##"${{{{{{{{{{{{{{{{{{{{ 20 open braces {{{{{{{{{{{{{{{{{{{{ 40 open braces {{{{{{{{{{{{{{{{{{{{ 60 open braces {{{{{{{{{{{{{{{{{{{{ 80 open braces {{{{{{{{{{{{{{{{{{{{ 100 open braces {{{{{{{{{{{{{{{{{{{{ 110 open braces {{{{{{{{{{{{{{{{{{{{ 120 open braces {{{{{{{{{{{{{{{{{{{{ 140 open braces {{{{{{{{{{{{{{{{{{{{ 160 open braces {{{{{{{{{{{{{{{{{{{{ 180 open braces {{{{{{{{{{{{{{{{{{{{ 200 open braces {{{{{{{{{{{{{{{{{{{{ 220 open braces {{{{{{{{{{{{{{{{{{{{ 240 open braces {{{{{{{{{{{{{{{ 255 open braces }}}}}}}}}}}}}}}}}}}} 20 close braces }}}}}}}}}}}}}}}}}}}} 40 close braces }}}}}}}}}}}}}}}}}}}} 60 close braces }}}}}}}}}}}}}}}}}}}} 80 close braces }}}}}}}}}}}}}}}}}}}} 100 close braces }}}}}}}}}}}}}}}}}}}} 120 close braces }}}}}}}}}}}}}}}}}}}} 140 close braces }}}}}}}}}}}}}}}}}}}} 160 close braces }}}}}}}}}}}}}}}}}}}} 180 close braces }}}}}}}}}}}}}}}}}}}} 200 close braces }}}}}}}}}}}}}}}}}}}} 220 close braces }}}}}}}}}}}}}}}}}}}} 240 close braces }}}}}}}}}}}}}}}{$ 255 close braces and one open brace "##; let expected = r##"

${{{{{{{{{{{{{{{{{{{{ 20 open braces {{{{{{{{{{{{{{{{{{{{ 40 open braces {{{{{{{{{{{{{{{{{{{{ 60 open braces {{{{{{{{{{{{{{{{{{{{ 80 open braces {{{{{{{{{{{{{{{{{{{{ 100 open braces {{{{{{{{{{{{{{{{{{{{ 110 open braces {{{{{{{{{{{{{{{{{{{{ 120 open braces {{{{{{{{{{{{{{{{{{{{ 140 open braces {{{{{{{{{{{{{{{{{{{{ 160 open braces {{{{{{{{{{{{{{{{{{{{ 180 open braces {{{{{{{{{{{{{{{{{{{{ 200 open braces {{{{{{{{{{{{{{{{{{{{ 220 open braces {{{{{{{{{{{{{{{{{{{{ 240 open braces {{{{{{{{{{{{{{{ 255 open braces }}}}}}}}}}}}}}}}}}}} 20 close braces }}}}}}}}}}}}}}}}}}}} 40 close braces }}}}}}}}}}}}}}}}}}}} 60 close braces }}}}}}}}}}}}}}}}}}}} 80 close braces }}}}}}}}}}}}}}}}}}}} 100 close braces }}}}}}}}}}}}}}}}}}}} 120 close braces }}}}}}}}}}}}}}}}}}}} 140 close braces }}}}}}}}}}}}}}}}}}}} 160 close braces }}}}}}}}}}}}}}}}}}}} 180 close braces }}}}}}}}}}}}}}}}}}}} 200 close braces }}}}}}}}}}}}}}}}}}}} 220 close braces }}}}}}}}}}}}}}}}}}}} 240 close braces }}}}}}}}}}}}}}}{$ 255 close braces and one open brace

"##; test_markdown_html(original, expected, false, false, false); }