# Defines single-line p-mode tests
#
# Input format is:
#
# LaTeX (single line)
# Resulting set of Nodes, as many lines as required.
# ==== (divider)
#
# Lines starting with '#' are documentation and are stripped out when running tests
#
##############################
Hello
Hello
====
{Hello}
Hello
====
{{Hello}}
Hello
====
Hello\par There
<p>Hello</p><p>There</p>
====
Hello\par\par There
<p>Hello</p><p>There</p>
====
Hello \par There
<p>Hello</p><p>There</p>
====
\begin{itemize}\end{itemize}
<ul/>
====
\begin{itemize} \item \end{itemize}
<ul><li/></ul>
====
\begin{itemize}\item Item 1 \item Item 2\end{itemize}
<ul><li>Item 1</li><li>Item 2</li></ul>
====
\begin{itemize} \item Item 1\end{itemize}
<ul><li>Item 1</li></ul>
====
\begin{itemize} \item Item 1 \end{itemize}
<ul><li>Item 1</li></ul>
====
\begin{itemize} \item \begin{itemize} \item A \end{itemize} \end{itemize}
<ul>
  <li>
    <ul>
      <li>A</li>
   </ul>
  </li>
</ul>
====
\begin{enumerate} \item A \end{enumerate}
<ol>
  <li>A</li>
</ol>
====
Break \par Paragraph \begin{itemize}\item Item 1 \item Item 2\end{itemize}
<p>Break</p><p>Paragraph</p><ul><li>Item 1</li><li>Item 2</li></ul>
====
\begin{itemize}\item Item 1 \par New Par \item Item 2\end{itemize}
<ul><li><p>Item 1</p><p>New Par</p></li><li>Item 2</li></ul>
====
Non-breaking~space
Non-breaking&#xa0;space
====
Hello< Upside-down exclamation mark
Hello&#xa1; Upside-down exclamation mark
====
Hello> Upside-down question mark
Hello&#xbf; Upside-down question mark
====
`Single Quotes'
&#x2018;Single Quotes&#x2019;
====
``Double Quotes''
&#x201c;Double Quotes&#x201d;
====
\begin{bf}Bold Text\end{bf}
<b>Bold Text</b>
====
\bf Bold Text
<b>Bold Text</b>
====
Change to \bf Bold Text
Change to <b>Bold Text</b>
====
Change to {\bf Bold Text}
Change to <b>Bold Text</b>
====
Change to \textbf{Bold Text}
Change to <b>Bold Text</b>
====
Empty $ $ Maths
Empty <math xmlns="http://www.w3.org/1998/Math/MathML"/> Maths
====
## Use of \ensuremath
\ensuremath{x}
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi></math>
====
\verb|x|
<span class="verb">x</span>
====
This is \verb|x| some verbatim
This is <span class="verb">x</span> some verbatim
====
This is \verb'verbatim!'
This is <span class="verb">verbatim!</span>
====
\verb!Verbatim With Space!
<span class="verb">Verbatim&#xa0;With&#xa0;Space</span>
====
\verb*!Verbatim With Space!
<span class="verb">Verbatim&#x2423;With&#x2423;Space</span>
====
\begin{verbatim}This is verbatim\end{verbatim}
<pre class="verbatim">This is verbatim</pre>
====
\begin{verbatim} This is verbatim \end{verbatim}?
<pre class="verbatim"> This is verbatim </pre>?
====
This is\,thin space
This is&#x2009;thin space
====
\newcommand{\test}[1]{Hello #1}Good
Good
====
\newcommand{\test}[1][]{Hello #1}Good
Good
====
\newcommand{\test}[2][]{Hello #1 #2}Good
Good
====
\newcommand{\test}[2][Sausage]{Hello #1 #2}Good
Good
====
\newcommand{\test}[1]{Hello #1}\test{There}
Hello There
====
\newcommand{\test}[1][]{Hello #1}\test[There]
Hello There
====
\newcommand{\test}[1][]{Hello#1}\test
Hello
====
\newcommand{\test}[1][There]{Hello #1}\test
Hello There
====
\newcommand{\test}[2][]{Hello #1 #2}\test[You]{There}
Hello You There
====
\newcommand{\test}[2][You]{Hello #1 #2}\test{There}
Hello You There
====
\newcommand{\test}[1]{Hello #1}\test{There} more text afterwards
Hello There more text afterwards
====
\newcommand{\test}[1]{Hello #1}\test{There}more text afterwards
Hello Theremore text afterwards
====
#         1         2         3         4
#12345678901234567890123456789012345678901234567890
\newcommand{\test}[1]{Hello #1}\test{\test{There}}
Hello Hello There
====
#         1         2         3         4
#1234567890123456789012345678901234567890123456789012345
\newcommand{\test}[1]{Hello #1}\test{\test{There}} More
Hello Hello There More
====
\newcommand{\test}[1]{Hello #1}\test{\test{There}}More
Hello Hello ThereMore
====
\newcommand{\test}[1]{Hello #1}\test{\test{\test{There}}}More
Hello Hello Hello ThereMore
====
#         1         2         3         4         5
#123456789012345678901234567890123456789012345678901234567
\newcommand{\bi}{\begin{itemize}}\bi \item A \end{itemize}
<ul><li>A</li></ul>
====
\newcommand{\test}{Hello}\renewcommand{\test}{There}\test
There
====
\newcommand{\test}[2]{1=#1 2=#2}\test{A}{B}
1=A 2=B
====
\newcommand{\test}[2][]{1=#1 2=#2}\test{A}
1= 2=A
====
\newcommand{\test}[2][]{1=#1 2=#2}\test[A]{B}
1=A 2=B
====
\newcommand{\test}[1]{#1#1}\test{\test{Hello}}
HelloHelloHelloHello
====
\newcommand{\test}{x}$\test$
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi></math>
====
\newcommand{\test}{\sin}$\test x$
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>sin</mi><mi>x</mi></math>
====
\newenvironment{test}{Begin}{End}Good
Good
====
\newenvironment{test}{Begin}{End}\begin{test}Hello\end{test}
BeginHelloEnd
====
\newenvironment{test}{Begin}{End}\begin{test} Hello \end{test}
Begin Hello End
====
\newenvironment{test}{Begin}{End}\begin{test}Hello\end{test}After
BeginHelloEndAfter
====
\newenvironment{test}{Begin}{End}\begin{test}Hello\end{test} After
BeginHelloEnd After
====
\newenvironment{test}{Begin}{End}\begin{test}\begin{itemize}\item A\end{itemize}\end{test}
<p>Begin</p>
<ul>
  <li>A</li>
</ul>
<p>End</p>
====
\newenvironment{test}{Begin}{End}\begin{test}A\begin{test}B\end{test}C\end{test}D
BeginABeginBEndCEndD
====
\newenvironment{test}[2]{#1 #2}{End}\begin{test}{A}{B}Hello\end{test}
A BHelloEnd
====
\newenvironment{test}[2][]{#1#2}{End}\begin{test}[A]{B}Hello\end{test}
ABHelloEnd
====
\newenvironment{test}[2][]{#1#2}{End}\begin{test}{B}Hello\end{test}
BHelloEnd
====
\newenvironment{test}[2][A]{#1#2}{End}\begin{test}[C]{B}Hello\end{test}
CBHelloEnd
====
\newenvironment{test}[2][A]{#1#2}{End}\begin{test}{B}Hello\end{test}
ABHelloEnd
====
\newenvironment{test}{A}{B}\renewenvironment{test}{C}{D}\begin{test}Hello\end{test}
CHelloD
====
## This is a more complex environment test
\newenvironment{x}{\begin{itemize}}{\end{itemize}}\begin{x}\item A\item B\end{x}
<ul><li>A</li><li>B</li></ul>
====
\'a\'a
&#xe1;&#xe1;
====
\`{a}
&#xe0;
====
\`{aa}
&#xe0;a
====
\begin{tabular}{cc} & \end{tabular}
<table class="tabular"><tbody><tr><td class="tabular align-center"/><td class="tabular align-center"/></tr></tbody></table>
====
\begin{tabular}{cc} & \\ & \end{tabular}
<table class="tabular">
  <tbody>
    <tr><td class="tabular align-center"/><td class="tabular align-center"/></tr>
    <tr><td class="tabular align-center"/><td class="tabular align-center"/></tr>
  </tbody>
</table>
====
\begin{tabular}{cc} 1 & 2 \\ 3 & 4 \end{tabular}
<table class="tabular">
  <tbody>
    <tr>
      <td class="tabular align-center">1</td>
      <td class="tabular align-center">2</td>
    </tr>
    <tr>
      <td class="tabular align-center">3</td>
      <td class="tabular align-center">4</td>
    </tr>
  </tbody>
</table>
====
\begin{tabular}{cc} 1 & 2 \\ 3 \end{tabular}
<table class="tabular">
  <tbody>
    <tr>
      <td class="tabular align-center">1</td>
      <td class="tabular align-center">2</td>
    </tr>
    <tr>
      <td class="tabular align-center">3</td>
      <td class="tabular align-center"></td>
    </tr>
  </tbody>
</table>
====
\begin{xmlBlockElement}{urn}{p:name}Hello\end{xmlBlockElement}
<p:name xmlns:p='urn'>Hello</p:name>
====
\begin{xmlBlockElement}[\xmlAttr{}{a}{b}]{urn}{p:name}Hello\end{xmlBlockElement}
<p:name a='b' xmlns:p='urn'>Hello</p:name>
====
\begin{xmlBlockElement}[\xmlAttr{urn:attr}{x:a}{b}]{urn}{p:name}Hello\end{xmlBlockElement}
<p:name x:a='b' xmlns:p='urn' xmlns:x='urn:attr'>Hello</p:name>
====
Hello \par There \begin{xmlBlockElement}{urn}{p:name}Hello\end{xmlBlockElement}
<p>Hello</p><p>There</p><p:name xmlns:p='urn'>Hello</p:name>
====
\xmlBlockElement{urn}{p:name}{Hello}
<p:name xmlns:p='urn'>Hello</p:name>
====
\xmlBlockElement[\xmlAttr{}{a}{b}]{urn}{p:name}{Hello}
<p:name a='b' xmlns:p='urn'>Hello</p:name>
====
\xmlBlockElement[\xmlAttr{urn:attr}{x:a}{b}]{urn}{p:name}{Hello}
<p:name x:a='b' xmlns:p='urn' xmlns:x='urn:attr'>Hello</p:name>
====
Hello \par There \xmlBlockElement{urn}{p:name}{Hello}
<p>Hello</p><p>There</p><p:name xmlns:p='urn'>Hello</p:name>
====
\xmlInlineElement{urn}{p:name}{Blah}
<p:name xmlns:p='urn'>Blah</p:name>
====
$1 + \xmlInlineElement{urn}{p:filter}{x}$
<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn><mo>+</mo><p:filter xmlns:p='urn'><mi>x</mi></p:filter></math>
====
\( a \)
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>a</mi></math>
====
\[ a \]
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mi>a</mi></math>
====
\newcommand{\bob}[1]{\xmlInlineElement{urn}{p:filter}{#1}}$1 + \bob{x}$
<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn><mo>+</mo><p:filter xmlns:p='urn'><mi>x</mi></p:filter></math>
====
Hello \xmlInlineElement{urn}{p:filter}{A\par B} There
Hello <p:filter xmlns:p='urn'><p>A</p><p>B</p></p:filter> There
====
\begin{eqnarray*} 1 & 2 \\ 3 & 4 \end{eqnarray*}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable>
    <mtr>
      <mtd columnalign="right"><mn>1</mn></mtd>
      <mtd columnalign="center"><mn>2</mn></mtd>
    </mtr>
    <mtr>
      <mtd columnalign="right"><mn>3</mn></mtd>
      <mtd columnalign="center"><mn>4</mn></mtd>
    </mtr>
  </mtable>
</math>
====
\begin{eqnarray} \mbox{Hello} & & x \end{eqnarray}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable>
    <mtr>
      <mtd columnalign="right">
        <mrow>
          <mtext>Hello</mtext>
        </mrow>
      </mtd>
      <mtd columnalign="center"/>
      <mtd columnalign="left">
        <mi>x</mi>
      </mtd>
    </mtr>
  </mtable>
</math>
====
\begin{eqnarray} 1+x & 2 \end{eqnarray}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable>
    <mtr>
      <mtd columnalign="right">
        <mn>1</mn>
        <mo>+</mo>
        <mi>x</mi>
      </mtd>
      <mtd columnalign="center">
        <mn>2</mn>
      </mtd>
    </mtr>
  </mtable>
</math>
====
# Horrible substitution to really test the way the tokeniser has been coded
\newcommand{\bob}{$}\bob 1 \bob
<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn></math>
====
## Test of a line break
Hello\\There
Hello<br />There
====
## Tests absorption of trailing spaces after commands
\dag Hello
&#x2020;Hello
====
\dag\ Hello
&#x2020;&#x00a0;Hello
====
## The following behaviour is actually correct, though you might not think so at first!
Hello{\rm There}
Hello<span class="rm">There</span>
====
\underline{Hello}
<span class="underline">Hello</span>
====
$\underline{x}$
<math xmlns="http://www.w3.org/1998/Math/MathML"><munder accentunder="true"><mi>x</mi><mo>&#xaf;</mo></munder></math>
====
1\% Following
1% Following
====
1\$ Following
1$ Following
====
1\# Following
1# Following
====
1\& Following
1&amp; Following
====
1\_ Following
1_ Following
====
\{Hello\}
{Hello}
====
$\{x\}$
<math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced open="{" close="}"><mi>x</mi></mfenced></math>
====
## Tests 1-arg user-defined commands with implicit argument search.
\newcommand{\bob}[1]{#1}\bob x
x
====
\begin{center} Hello! \end{center}
<div class="center">Hello!</div>
====
\fbox{Hello}
<span class="fbox">Hello</span>
====
\Huge This is \small small
<span class="huge2">This is </span><span class="small">small</span>
====
\textrm{Hello}
<span class="rm">Hello</span>
====
## This test checks that MATH and TEXT styles are kept separate
\bf Hello $x$
<b>Hello <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>x</mi></math></b>
====
## This was breaking the tokeniser
\newcommand{\hello}{A \\}\hello
A <br/>
====
## Hspace tests
A\hspace{1cm}B
A<span style="margin-left:1.0cm;font-size:0">&#xa0;</span>B
====
## The following test various types of limit operators in inline/displaymath modes
$\int_0^1$
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mo>&#x222b;</mo><mn>0</mn><mn>1</mn></msubsup></math>
====
$$\int_0^1$$
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><msubsup><mo>&#x222b;</mo><mn>0</mn><mn>1</mn></msubsup></math>
====
$\sum_1^n$
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mo>&#x2211;</mo><mn>1</mn><mi>n</mi></msubsup></math>
====
$$\sum_1^n$$
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><munderover><mo>&#x2211;</mo><mn>1</mn><mi>n</mi></munderover></math>
====
## Hyphens
Hello - There
Hello - There
====
Hello -- There
Hello &#x2013; There
====
Hello --- There
Hello &#x2014; There
====
Hello|There
Hello&#x2014;There
====
\href[My Web Site]{http://www.ph.ed.ac.uk/~dmckain}
<a href="http://www.ph.ed.ac.uk/~dmckain">My Web Site</a>
====
\href{urn:x#a}
<a href="urn:x#a">urn:x#a</a>
====
\href{urn:x%20b}
<a href="urn:x%20b">urn:x%20b</a>
====
\anchor{susan}
<a id="susan"/>
====
\xmlName{a}
a
====
\xmlUnparse{$x$}
<span class="unparsed-xml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;</span>
====
\ux{31}
1
====
# Demonstrates the starred variants of these parse argument in LR mode
\newcommand{\a}[1]{X-#1}\xmlName*{\a{1}}
X-1
====
\xmlId{a}
a
====
\literal{ # %}
 # %
====
## Test of functionality for managing simple "variables"
\setvar{x}{Hello}\getvar{x}
Hello
====
\setvar[ns]{x}{Hello}\getvar[ns]{x}
Hello
====
A\setvar{x}{Hello}\getvar[ns]{x}
A
====
A\setvar[ns]{x}{Hello}\getvar{x}
A
====
## Regression: Empty style commands were not being handled correctly before. Silly me!
## (Note: the result of this changed in 1.3.0.)
X{\rm }
X
====
## Regression: Bug 2801656
\verb|%|
<span class="verb">%</span>
====
## Regression: handling of whitespace in mboxes was incomplete through to 1.2.0
\mbox{ }
<span class="mbox"> </span>
====
\mbox{ A }
<span class="mbox"> A </span>
====
## Regression: handling of \# in user-defined command/env substitutions did not work correctly through to 1.2.1
\newcommand{\bob}[1]{Hello\#1\#2}\bob{unused}
Hello#1#2
====
\newenvironment{bob}[2]{Start#1\#2}{End}\begin{bob}{X}{Y}Hello\end{bob}
StartX#2HelloEnd
====
