diff options
Diffstat (limited to 'test/command')
188 files changed, 4889 insertions, 0 deletions
diff --git a/test/command/1166.md b/test/command/1166.md new file mode 100644 index 000000000..756a065db --- /dev/null +++ b/test/command/1166.md @@ -0,0 +1,48 @@ +See #1166 and <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables>. + +``` +% pandoc -f rst -t html5 +===== ===== +col 1 col 2 +===== ===== +1 Second column of row 1. +2 Second column of row 2. + Second line of paragraph. +3 - Second column of row 3. + + - Second item in bullet + list (row 3, column 2). +\ Row 4; column 1 will be empty. +===== ===== +^D +<table> +<thead> +<tr class="header"> +<th>col 1</th> +<th>col 2</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>1</td> +<td>Second column of row 1.</td> +</tr> +<tr class="even"> +<td><p>2</p></td> +<td><p>Second column of row 2. Second line of paragraph.</p></td> +</tr> +<tr class="odd"> +<td><p>3</p></td> +<td><ul> +<li>Second column of row 3.</li> +<li>Second item in bullet list (row 3, column 2).</li> +</ul></td> +</tr> +<tr class="even"> +<td></td> +<td>Row 4; column 1 will be empty.</td> +</tr> +</tbody> +</table> +``` + diff --git a/test/command/1279.md b/test/command/1279.md new file mode 100644 index 000000000..c8396f217 --- /dev/null +++ b/test/command/1279.md @@ -0,0 +1,19 @@ +``` +pandoc -s -t markdown +--- +author: 'John Doe[^1]' +date: 2014 +title: My Article +--- + +[^1]: Dept. of This and That +^D +--- +author: 'John Doe[^1]' +date: 2014 +title: My Article +--- + +[^1]: Dept. of This and That +``` + diff --git a/test/command/1390.md b/test/command/1390.md new file mode 100644 index 000000000..ffd2cef8d --- /dev/null +++ b/test/command/1390.md @@ -0,0 +1,20 @@ +``` +% pandoc -f latex -t native +\newcommand\foo{+} +Testing: $\mu\foo\eta$. +^D +[Para [Str "Testing:",Space,Math InlineMath "\\mu+\\eta",Str "."]] +``` + +<!-- It would be nice to handle this case, but I don't +know how: + +``` +% pandoc -f latex -t native +\newcommand{\vecx}{a + b} +$\hat\vecx$ +^D +[Para [Math InlineMath "\\hat{a+b}"]] +``` +--> + diff --git a/test/command/1592.md b/test/command/1592.md new file mode 100644 index 000000000..54e59137b --- /dev/null +++ b/test/command/1592.md @@ -0,0 +1,49 @@ +``` +% pandoc -t native +[hi]{.smallcaps} +^D +[Para [SmallCaps [Str "hi"]]] +``` + +``` +% pandoc -t native +[hi]{style="font-variant: small-caps;"} +^D +[Para [SmallCaps [Str "hi"]]] +``` + +``` +% pandoc -t native +<span class="smallcaps">hi</span> +^D +[Para [SmallCaps [Str "hi"]]] +``` + +``` +% pandoc -f html -t native +<p><span class="smallcaps">hi</span></p> +^D +[Para [SmallCaps [Str "hi"]]] +``` + +``` +% pandoc -f html -t native +<p><span style="font-variant:small-caps">hi</span></p> +^D +[Para [SmallCaps [Str "hi"]]] +``` + +``` +% pandoc -f native -t html +[Para [SmallCaps [Str "hi"]]] +^D +<p><span class="smallcaps">hi</span></p> +``` + +``` +pandoc -f native -t markdown +[Para [SmallCaps [Str "hi"]]] +^D +[hi]{.smallcaps} +``` + diff --git a/test/command/1629.md b/test/command/1629.md new file mode 100644 index 000000000..34d529b0d --- /dev/null +++ b/test/command/1629.md @@ -0,0 +1,10 @@ +``` +% pandoc -t latex --listings +bla bla `a % b` + +*bla bla `a % b`* +^D +bla bla \passthrough{\lstinline!a \% b!} + +\emph{bla bla \passthrough{\lstinline!a \% b!}} +``` diff --git a/test/command/168.md b/test/command/168.md new file mode 100644 index 000000000..43c3b865a --- /dev/null +++ b/test/command/168.md @@ -0,0 +1,43 @@ +``` +% pandoc -t native +:::::::::: warning :::::::::::: +This is the warning! + +1. list +2. another + +::: {#myid .class key=val} +nested div +::: +::::::::::::::::::::::::::::::: +^D +[Div ("",["warning"],[]) + [Para [Str "This",Space,Str "is",Space,Str "the",Space,Str "warning!"] + ,OrderedList (1,Decimal,Period) + [[Plain [Str "list"]] + ,[Plain [Str "another"]]] + ,Div ("myid",["class"],[("key","val")]) + [Para [Str "nested",Space,Str "div"]]]] +``` + +``` +% pandoc -t native +foo +::: +bar +^D +[Para [Str "foo",SoftBreak,Str ":::",SoftBreak,Str "bar"]] +``` + +``` +% pandoc -t native +::::: Warning +Here is a paragraph. + +And another. +::::: +^D +[Div ("",["Warning"],[]) + [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "paragraph."] + ,Para [Str "And",Space,Str "another."]]] +``` diff --git a/test/command/1710.md b/test/command/1710.md new file mode 100644 index 000000000..d14f1217f --- /dev/null +++ b/test/command/1710.md @@ -0,0 +1,89 @@ +``` +% pandoc -t revealjs +# Slide one + +<div class="columns"> +<div class="column" width="40%"> +- a +- b +</div> +<div class="column" width="40%"> +- c +- d +</div> +<div class="column" width="10%"> +ok +</div> +</div> +^D +<section id="slide-one" class="slide level1"> +<h1>Slide one</h1> +<div class="columns"> +<div class="column" style="width:40%;"> +<ul> +<li>a</li> +<li>b</li> +</ul> +</div><div class="column" style="width:40%;"> +<ul> +<li>c</li> +<li>d</li> +</ul> +</div><div class="column" style="width:10%;"> +<p>ok</p> +</div> +</div> +</section> +``` + +``` +% pandoc -t beamer +# Slide one + +<div class="columns"> +<div class="column" width="40%"> +- a +- b +</div> +<div class="column" width="40%"> +- c +- d +</div> +<div class="column" width="10%"> +ok +</div> +</div> +^D +\begin{frame}{% +\protect\hypertarget{slide-one}{% +Slide one}} + +\begin{columns}[T] +\begin{column}{0.40\textwidth} +\begin{itemize} +\tightlist +\item + a +\item + b +\end{itemize} +\end{column} + +\begin{column}{0.40\textwidth} +\begin{itemize} +\tightlist +\item + c +\item + d +\end{itemize} +\end{column} + +\begin{column}{0.10\textwidth} +ok +\end{column} +\end{columns} + +\end{frame} +``` + diff --git a/test/command/1718.md b/test/command/1718.md new file mode 100644 index 000000000..7e07bf1e9 --- /dev/null +++ b/test/command/1718.md @@ -0,0 +1,11 @@ +``` +% pandoc -t native +Note[^1]. + +[^1]: the first note. + +[^2]: the second, unused, note. +^D +[WARNING] Note with key '2' defined at line 5 column 1 but not used. +[Para [Str "Note",Note [Para [Str "the",Space,Str "first",Space,Str "note."]],Str "."]] +``` diff --git a/test/command/1745.md b/test/command/1745.md new file mode 100644 index 000000000..cf987c20f --- /dev/null +++ b/test/command/1745.md @@ -0,0 +1,13 @@ +``` +% pandoc -f latex+auto_identifiers -t html +\section{Six favourite beers} +\subsection{Jovaru Alus}\label{jovaru-alus} +\section{Farmhouse brewers} +\subsection{Jovaru Alus} +^D +<h1 id="six-favourite-beers">Six favourite beers</h1> +<h2 id="jovaru-alus">Jovaru Alus</h2> +<h1 id="farmhouse-brewers">Farmhouse brewers</h1> +<h2 id="jovaru-alus-1">Jovaru Alus</h2> +``` + diff --git a/test/command/1773.md b/test/command/1773.md new file mode 100644 index 000000000..b93267287 --- /dev/null +++ b/test/command/1773.md @@ -0,0 +1,6 @@ +``` +% pandoc -f latex+raw_tex -t native +\noindent hi +^D +[Para [RawInline (Format "latex") "\\noindent ",Str "hi"]] +``` diff --git a/test/command/1841.md b/test/command/1841.md new file mode 100644 index 000000000..408f224bd --- /dev/null +++ b/test/command/1841.md @@ -0,0 +1,42 @@ +``` +% pandoc +<table> +<tr> +<td> *one*</td> +<td> [a link](http://google.com)</td> +</tr> +</table> +^D +<table> +<tr> +<td> +<em>one</em> +</td> +<td> +<a href="http://google.com">a link</a> +</td> +</tr> +</table> +``` + +``` +% pandoc +<table> + <tr> + <td>*one*</td> + <td>[a link](http://google.com)</td> + </tr> +</table> +^D +<table> +<tr> +<td> +<em>one</em> +</td> +<td> +<a href="http://google.com">a link</a> +</td> +</tr> +</table> +``` + diff --git a/test/command/1881.md b/test/command/1881.md new file mode 100644 index 000000000..c0902de71 --- /dev/null +++ b/test/command/1881.md @@ -0,0 +1,55 @@ +``` +% pandoc -f html -t native +<table> +<caption>Demonstration of simple table syntax.</caption> +<thead> +<tr class="header"> +<th align="right">Right</th> +<th align="left">Left</th> +<th align="center">Center</th> +<th>Default</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="right">12</td> +<td align="left">12</td> +<td align="center">12</td> +<td>12</td> +</tr> +</tbody> +</table> +^D +[Table [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] [AlignRight,AlignLeft,AlignCenter,AlignDefault] [0.0,0.0,0.0,0.0] + [[Plain [Str "Right"]] + ,[Plain [Str "Left"]] + ,[Plain [Str "Center"]] + ,[Plain [Str "Default"]]] + [[[Plain [Str "12"]] + ,[Plain [Str "12"]] + ,[Plain [Str "12"]] + ,[Plain [Str "12"]]]]] +``` + +``` +% pandoc -f html -t native +<table> +<tr class="odd"> +<td style="text-align: right;">12</td> +<td style="text-align:left;">12</td> +<td style="text-align: center">12</td> +<td style="text-align: right;">12</td> +</tr> +</table> +^D +[Table [] [AlignRight,AlignLeft,AlignCenter,AlignRight] [0.0,0.0,0.0,0.0] + [[] + ,[] + ,[] + ,[]] + [[[Plain [Str "12"]] + ,[Plain [Str "12"]] + ,[Plain [Str "12"]] + ,[Plain [Str "12"]]]]] +``` + diff --git a/test/command/1905.md b/test/command/1905.md new file mode 100644 index 000000000..744d1c4d9 --- /dev/null +++ b/test/command/1905.md @@ -0,0 +1,30 @@ +``` +% pandoc -f latex-auto_identifiers -t html +\chapter{chapone} +\part{partone} +\chapter{chaptwo} +\section{secone} +^D +<h2>chapone</h2> +<h1>partone</h1> +<h2>chaptwo</h2> +<h3>secone</h3> +``` + +``` +% pandoc -f latex-auto_identifiers -t html +\chapter{chapone} +\chapter{chaptwo} +\section{secone} +^D +<h1>chapone</h1> +<h1>chaptwo</h1> +<h2>secone</h2> +``` + +``` +% pandoc -f latex-auto_identifiers -t html +\section{secone} +^D +<h1>secone</h1> +``` diff --git a/test/command/2118.md b/test/command/2118.md new file mode 100644 index 000000000..27b3723d3 --- /dev/null +++ b/test/command/2118.md @@ -0,0 +1,11 @@ +``` +% pandoc -f latex -t native +\newcommand{\inclgraph}{\includegraphics[width=0.8\textwidth]} +\begin{figure}[ht] + \inclgraph{setminus.png} + \caption{Set subtraction} + \label{fig:setminus} +\end{figure} +^D +[Para [Image ("",[],[("width","80%")]) [Str "Set",Space,Str "subtraction",Span ("",[],[("label","fig:setminus")]) []] ("setminus.png","fig:")]] +``` diff --git a/test/command/2228.md b/test/command/2228.md new file mode 100644 index 000000000..589a2350e --- /dev/null +++ b/test/command/2228.md @@ -0,0 +1,6 @@ +``` +% pandoc -f markdown+smart -t latex+smart +*foo*'s 'foo' +^D +\emph{foo}'s `foo' +``` diff --git a/test/command/2378.md b/test/command/2378.md new file mode 100644 index 000000000..801c168ad --- /dev/null +++ b/test/command/2378.md @@ -0,0 +1,27 @@ +Ensure that we don't get duplicated footnotes when +a note occurs in a header cell and `\endfirsthead` +is used. + +``` +% pandoc -t latex +| x | y[^fn] | +|-|-| +|1|2| +: a table + +[^fn]: a footnote +^D +\begin{longtable}[]{@{}ll@{}} +\caption{a table}\tabularnewline +\toprule +x & y\footnote{a footnote}\tabularnewline +\midrule +\endfirsthead +\toprule +x & y{}\tabularnewline +\midrule +\endhead +1 & 2\tabularnewline +\bottomrule +\end{longtable} +``` diff --git a/test/command/2397.md b/test/command/2397.md new file mode 100644 index 000000000..34d201362 --- /dev/null +++ b/test/command/2397.md @@ -0,0 +1,9 @@ +``` +% pandoc -f markdown_mmd +# Chapter 1: A long name of chapter [Chapter 1] + +See [Chapter 1]. +^D +<h1 id="chapter1">Chapter 1: A long name of chapter</h1> +<p>See <a href="#chapter1">Chapter 1</a>.</p> +``` diff --git a/test/command/2434.md b/test/command/2434.md new file mode 100644 index 000000000..4f12b6f56 --- /dev/null +++ b/test/command/2434.md @@ -0,0 +1,59 @@ +``` +% pandoc -t opendocument +1. a +2. b + 1. alpha + 2. beta + * gamma +^D +<text:list text:style-name="L1"> + <text:list-item> + <text:p text:style-name="P1">a</text:p> + </text:list-item> + <text:list-item> + <text:p text:style-name="P1">b</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P1">alpha</text:p> + </text:list-item> + <text:list-item> + <text:p text:style-name="P1">beta</text:p> + </text:list-item> + </text:list> + <text:list text:style-name="L2"> + <text:list-item> + <text:p text:style-name="P2">gamma</text:p> + </text:list-item> + </text:list> + </text:list-item> +</text:list> +``` + +``` +% pandoc -t opendocument +(@) text + + some text + + a) sub item 1 + b) sub item 2 + + more text -- this line is missing in the odt output +^D +<text:list text:style-name="L1"> + <text:list-item> + <text:p text:style-name="P1">text</text:p> + <text:p text:style-name="P1">some text</text:p> + <text:list> + <text:list-item> + <text:p text:style-name="P1">sub item 1</text:p> + </text:list-item> + <text:list-item> + <text:p text:style-name="P1">sub item 2</text:p> + </text:list-item> + </text:list> + <text:p text:style-name="P1">more text – this line is missing in the + odt output</text:p> + </text:list-item> +</text:list> +``` diff --git a/test/command/2549.md b/test/command/2549.md new file mode 100644 index 000000000..8f4aea852 --- /dev/null +++ b/test/command/2549.md @@ -0,0 +1,38 @@ +``` +% pandoc -f latex -t native +\hypertarget{foo}{% +\section{A section}\label{foo} +} +^D +[Header 1 ("foo",[],[]) [Str "A",Space,Str "section"]] +``` + +``` +% pandoc -f latex -t native +\hypertarget{bar}{% +\section{A section}\label{foo} +} +^D +[Div ("bar",[],[]) + [Header 1 ("foo",[],[]) [Str "A",Space,Str "section"]]] +``` + +``` +% pandoc -f latex -t native +Bar \hypertarget{foo}{Foo} +^D +[Para [Str "Bar",Space,Span ("foo",[],[]) [Str "Foo"]]] +``` + +``` +% pandoc -f latex -t native +\hypertarget{foo}{% +\begin{verbatim} +bar +\end{verbatim} +} +^D +[Div ("foo",[],[]) + [CodeBlock ("",[],[]) "bar"]] +``` + diff --git a/test/command/2552.md b/test/command/2552.md new file mode 100644 index 000000000..90a3a381c --- /dev/null +++ b/test/command/2552.md @@ -0,0 +1,14 @@ +``` +% pandoc --strip-comments +Foo + +bar + +<!-- comment --> + +baz<!-- bim -->boop +^D +<p>Foo</p> +<p>bar</p> +<p>bazboop</p> +``` diff --git a/test/command/256.md b/test/command/256.md new file mode 100644 index 000000000..08e483e5c --- /dev/null +++ b/test/command/256.md @@ -0,0 +1,12 @@ +``` +% pandoc --abbreviations=command/abbrevs -t native +Foo. bar baz h.k. and e.g. and Mr. Brown. +^D +[Para [Str "Foo.\160bar",Space,Str "baz",Space,Str "h.k.\160and",Space,Str "e.g.",Space,Str "and",Space,Str "Mr.",Space,Str "Brown."]] +``` +``` +% pandoc -t native +Foo. bar baz h.k. and e.g. and Mr. Brown. +^D +[Para [Str "Foo.",Space,Str "bar",Space,Str "baz",Space,Str "h.k.",Space,Str "and",Space,Str "e.g.\160and",Space,Str "Mr.\160Brown."]] +``` diff --git a/test/command/2602.md b/test/command/2602.md new file mode 100644 index 000000000..5ed4b581c --- /dev/null +++ b/test/command/2602.md @@ -0,0 +1,18 @@ +``` +% pandoc +[a] [b] + +[b]: url +^D +<p>[a] <a href="url">b</a></p> +``` + +``` +% pandoc -f markdown+spaced_reference_links +[a] [b] + +[b]: url +^D +<p><a href="url">a</a></p> +``` + diff --git a/test/command/2606.md b/test/command/2606.md new file mode 100644 index 000000000..53eaa0d06 --- /dev/null +++ b/test/command/2606.md @@ -0,0 +1,58 @@ +``` +% pandoc -f mediawiki -t html5 +{| +| * hello +|} +^D +<table> +<tbody> +<tr class="odd"> +<td><p>* hello</p></td> +</tr> +</tbody> +</table> +``` + +``` +% pandoc -f mediawiki -t html5 +{| +| +* hello +|} +^D +<table> +<tbody> +<tr class="odd"> +<td><ul> +<li>hello</li> +</ul></td> +</tr> +</tbody> +</table> +``` + +``` +% pandoc -f mediawiki -t html5 +{| +| + * hello +|} +^D +<table> +<tbody> +<tr class="odd"> +<td><p><code>* hello</code></p></td> +</tr> +</tbody> +</table> +``` + +``` +% pandoc -f mediawiki -t html5 +* * hi +^D +<ul> +<li>* hi</li> +</ul> +``` + diff --git a/test/command/262.md b/test/command/262.md new file mode 100644 index 000000000..bda2acb35 --- /dev/null +++ b/test/command/262.md @@ -0,0 +1,26 @@ +``` +% pandoc -f rst +`hello`_ and `goodbye`_ + +.. _hello: +.. _goodbye: example.com +^D +<p><a href="example.com">hello</a> and <a href="example.com">goodbye</a></p> +``` + +``` +% pandoc -f rst +`hello`_ `goodbye`_ + +.. _hello: +.. _goodbye: + +paragraph +^D +<p><a href="#hello">hello</a> <a href="#goodbye">goodbye</a></p> +<div id="hello"> +<div id="goodbye"> +<p>paragraph</p> +</div> +</div> +``` diff --git a/test/command/2649.md b/test/command/2649.md new file mode 100644 index 000000000..8f594cfe1 --- /dev/null +++ b/test/command/2649.md @@ -0,0 +1,106 @@ +``` +% pandoc -f mediawiki -t html5 +{| class="wikitable" style="line-height: 1.0" + +|- bgcolor="#efefef" +|} +^D +<table> +<tbody> +<tr class="odd"> +</tr> +</tbody> +</table> +``` + +``` +% pandoc -f mediawiki -t html5 +{| border="4" cellspacing="2" cellpadding="0" WIDTH="100%" +|----- +| peildatum Simbase || november 2005 || '''uitslagen Flohrgambiet''' || +|----- +| totaal aantal partijen Simbase || 7.316.773 +| wit wint || 53% +|----- +| percentage (en partijen) Flohrgambiet +| 0.023 % (1.699) || zwart wint || 27% +|----- +| percentage Flohrgambiet in aug 2003 +| 0.035 % || remise || 20% +|} +^D +<table> +<tbody> +<tr class="odd"> +<td><p>peildatum Simbase</p></td> +<td><p>november 2005</p></td> +<td><p><strong>uitslagen Flohrgambiet</strong></p></td> +<td></td> +</tr> +<tr class="even"> +<td><p>totaal aantal partijen Simbase</p></td> +<td><p>7.316.773</p></td> +<td><p>wit wint</p></td> +<td><p>53%</p></td> +</tr> +<tr class="odd"> +<td><p>percentage (en partijen) Flohrgambiet</p></td> +<td><p>0.023 % (1.699)</p></td> +<td><p>zwart wint</p></td> +<td><p>27%</p></td> +</tr> +<tr class="even"> +<td><p>percentage Flohrgambiet in aug 2003</p></td> +<td><p>0.035 %</p></td> +<td><p>remise</p></td> +<td><p>20%</p></td> +</tr> +</tbody> +</table> +``` + +``` +% pandoc -f mediawiki -t html5 +{| class="wikitable" style="text-align:center; font-size:95%" valign="top" | +! Plaats +! Rijder +! Aantal +|- +| 1 +|align=left| {{FR-VLAG}} [[Sébastien Loeb]] | 78 +|- +| 2 +|align=left| {{FR-VLAG}} '''[[Sébastien Ogier]]''' +| 38 +|- +| 10 +|align=left| {{FI-VLAG}} [[Hannu Mikkola]] +| 18 +|} +^D +<table> +<tbody> +<tr class="odd"> +<td></td> +<td><p>Plaats</p></td> +<td><p>Rijder</p></td> +<td><p>Aantal</p></td> +</tr> +<tr class="even"> +<td><p>1</p></td> +<td><p><a href="Sébastien_Loeb" title="wikilink">Sébastien Loeb</a></p></td> +<td><p>78</p></td> +</tr> +<tr class="odd"> +<td><p>2</p></td> +<td><p><strong><a href="Sébastien_Ogier" title="wikilink">Sébastien Ogier</a></strong></p></td> +<td><p>38</p></td> +</tr> +<tr class="even"> +<td><p>10</p></td> +<td><p><a href="Hannu_Mikkola" title="wikilink">Hannu Mikkola</a></p></td> +<td><p>18</p></td> +</tr> +</tbody> +</table> +``` diff --git a/test/command/2662.md b/test/command/2662.md new file mode 100644 index 000000000..543209053 --- /dev/null +++ b/test/command/2662.md @@ -0,0 +1,11 @@ +``` +% pandoc -t html -f rst --wrap=none +.. image:: http://url.to.image/foo.png + :align: left + :height: 100px + :width: 200 px + :scale: 300 % + :alt: alternate text +^D +<p><img src="http://url.to.image/foo.png" alt="alternate text" class="align-left" width="600" height="300" /></p> +``` diff --git a/test/command/2834.md b/test/command/2834.md new file mode 100644 index 000000000..850c39254 --- /dev/null +++ b/test/command/2834.md @@ -0,0 +1,29 @@ +Nested grid tables. +``` +% pandoc -f html -t markdown --columns=72 +<table> + <tr> + <td> + <table> + <tr> + <td> + <table> + <tr> + <td>some text</td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> +^D ++-----------------------------------------------------------------------+ +| +------------------------------------------------------------------+ | +| | ----------- | | +| | some text | | +| | ----------- | | +| +------------------------------------------------------------------+ | ++-----------------------------------------------------------------------+ +``` diff --git a/test/command/2874.md b/test/command/2874.md new file mode 100644 index 000000000..1fb530dc1 --- /dev/null +++ b/test/command/2874.md @@ -0,0 +1,14 @@ +``` +% pandoc -f html -t latex +<a></a> +<br/> +^D +{}~\\ +``` + +``` +% pandoc -f html -t latex +<a name="foo"></a><br/> +^D +\protect\hypertarget{foo}{}{}~\\ +``` diff --git a/test/command/2994.md b/test/command/2994.md new file mode 100644 index 000000000..b6b2d1ed9 --- /dev/null +++ b/test/command/2994.md @@ -0,0 +1,10 @@ +``` +% pandoc -f markdown -t docx -o - | pandoc -f docx -t markdown --track-changes=all +I want [I left a comment.]{.comment-start id="0" +author="Jesse Rosenthal" date="2016-05-09T16:13:00Z"}some text to have a +comment []{.comment-end id="0"}on it. +^D +I want [I left a comment.]{.comment-start id="0" +author="Jesse Rosenthal" date="2016-05-09T16:13:00Z"}some text to have a +comment []{.comment-end id="0"}on it. +``` diff --git a/test/command/3113.md b/test/command/3113.md new file mode 100644 index 000000000..5ca171d97 --- /dev/null +++ b/test/command/3113.md @@ -0,0 +1,13 @@ +``` +% pandoc -f latex -t native +\begin{eqnarray} +A&=&B,\\ +C&=&D,\\ +%\end{eqnarray} +%\begin{eqnarray} +E&=&F +\end{eqnarray} +^D +[Para [Math DisplayMath "\\begin{aligned}\nA&=&B,\\\\\nC&=&D,\\\\\n%\\end{eqnarray}\n%\\begin{eqnarray}\nE&=&F\\end{aligned}"]] +``` + diff --git a/test/command/3236.md b/test/command/3236.md new file mode 100644 index 000000000..1d1a9b2c3 --- /dev/null +++ b/test/command/3236.md @@ -0,0 +1,9 @@ +``` +pandoc -f latex -t native +\newcommand{\mycolor}{red} + +\includegraphics[width=17cm]{\mycolor /header} +Magnificent \mycolor{} header. +^D +[Para [Image ("",[],[("width","17cm")]) [Str "image"] ("red/header",""),SoftBreak,Str "Magnificent",Space,Str "red",Space,Str "header."]] +``` diff --git a/test/command/3257.md b/test/command/3257.md new file mode 100644 index 000000000..31d9426ee --- /dev/null +++ b/test/command/3257.md @@ -0,0 +1,13 @@ +``` +% pandoc -t native +(i<j) +^D +[Para [Str "(i<j)"]] +``` + +``` +% pandoc -t native +i<j-1, j>k +^D +[Para [Str "i<j-1,",Space,Str "j>k"]] +``` diff --git a/test/command/3309.md b/test/command/3309.md new file mode 100644 index 000000000..083ac53c9 --- /dev/null +++ b/test/command/3309.md @@ -0,0 +1,52 @@ +Certain environments should be treated as inline unless they +are surrounded by blank lines: + +``` +% pandoc -t latex --wrap=preserve +Lorem ipsum dolor sit amet, + +\begin{equation} +E = mc^2, +\end{equation} + +consectetur adipiscing elit. +^D +Lorem ipsum dolor sit amet, + +\begin{equation} +E = mc^2, +\end{equation} + +consectetur adipiscing elit. +``` + +``` +% pandoc -t latex --wrap=preserve +Lorem ipsum dolor sit amet, +\begin{equation} +E = mc^2, +\end{equation} +consectetur adipiscing elit. +^D +Lorem ipsum dolor sit amet, +\begin{equation} +E = mc^2, +\end{equation} +consectetur adipiscing elit. +``` + +``` +% pandoc -t latex --wrap=preserve +The formula +\begin{math} +x = y +\end{math} +should be inline. +^D +The formula +\begin{math} +x = y +\end{math} +should be inline. +``` + diff --git a/test/command/3314.md b/test/command/3314.md new file mode 100644 index 000000000..064b04cbd --- /dev/null +++ b/test/command/3314.md @@ -0,0 +1,34 @@ +See #3315 and <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables>. + +``` +% pandoc -f org -t html5 ++-----------+-------+----------+ +| First | 12.0 | Example | +| | | row | +| | | spanning | +| | | lines | ++-----------+-------+----------+ +| Second | 5.0 | Another | ++-----------+-------+----------+ +^D +<table style="width:43%;"> +<colgroup> +<col style="width: 16%" /> +<col style="width: 11%" /> +<col style="width: 15%" /> +</colgroup> +<tbody> +<tr class="odd"> +<td>First</td> +<td>12.0</td> +<td>Example row spanning lines</td> +</tr> +<tr class="even"> +<td>Second</td> +<td>5.0</td> +<td>Another</td> +</tr> +</tbody> +</table> +``` + diff --git a/test/command/3337.md b/test/command/3337.md new file mode 100644 index 000000000..7ba14dcbb --- /dev/null +++ b/test/command/3337.md @@ -0,0 +1,13 @@ +``` +% pandoc -f html -t markdown +<table> +<tr><td>a</td></tr> +<tr><td>1</td><td>2</td></tr> +</table> +^D + --- --- + a + 1 2 + --- --- +``` + diff --git a/test/command/3348.md b/test/command/3348.md new file mode 100644 index 000000000..1457373c8 --- /dev/null +++ b/test/command/3348.md @@ -0,0 +1,17 @@ +``` +% pandoc -t native --columns=72 + ----- ------------------------------------------------ + foo bar + + foo this is a long + line of text + ----- ------------------------------------------------ +^D +[Table [] [AlignRight,AlignLeft] [8.333333333333333e-2,0.6666666666666666] + [[] + ,[]] + [[[Plain [Str "foo"]] + ,[Plain [Str "bar"]]] + ,[[Plain [Str "foo"]] + ,[Plain [Str "this",Space,Str "is",Space,Str "a",Space,Str "long",SoftBreak,Str "line",Space,Str "of",Space,Str "text"]]]]] +``` diff --git a/test/command/3401.md b/test/command/3401.md new file mode 100644 index 000000000..99528553a --- /dev/null +++ b/test/command/3401.md @@ -0,0 +1,19 @@ +See #3401 and <http://orgmode.org/manual/Macro-replacement.html> + +``` +% pandoc -f org -t native +#+MACRO: HELLO /Hello, $1/ +{{{HELLO(World)}}} +^D +[Para [Emph [Str "Hello,",Space,Str "World"]]] +``` + +Inverted argument order + +``` +% pandoc -f org -t native +#+MACRO: A $2,$1 +{{{A(1,2)}}} +^D +[Para [Str "2,1"]] +``` diff --git a/test/command/3407.md b/test/command/3407.md new file mode 100644 index 000000000..3160d1263 --- /dev/null +++ b/test/command/3407.md @@ -0,0 +1,13 @@ +``` +% pandoc -f native -t rst +[Para [Span ("",[],[("role","foo")]) [Str "text"]]] +^D +:foo:`text` +``` + +``` +% pandoc -f rst -t native +:foo:`text` +^D +[Para [Span ("",[],[("role","foo")]) [Str "text"]]] +``` diff --git a/test/command/3422.md b/test/command/3422.md new file mode 100644 index 000000000..19f1f4462 --- /dev/null +++ b/test/command/3422.md @@ -0,0 +1,9 @@ +See #3422 + +``` +% pandoc -t latex --listings +`int main(int argc, const char *argv[]);`{.c} +^D +\passthrough{\lstinline[language=C]!int main(int argc, const char *argv[]);!} +``` + diff --git a/test/command/3432.md b/test/command/3432.md new file mode 100644 index 000000000..7264d22c3 --- /dev/null +++ b/test/command/3432.md @@ -0,0 +1,289 @@ +List-table with header-rows and widths options. + +``` +% pandoc -f rst +.. list-table:: Frozen Delights! + :widths: 15 10 30 + :header-rows: 1 + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - On a stick! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +^D +<table> +<caption>Frozen Delights!</caption> +<colgroup> +<col style="width: 27%" /> +<col style="width: 18%" /> +<col style="width: 54%" /> +</colgroup> +<thead> +<tr class="header"> +<th>Treat</th> +<th>Quantity</th> +<th>Description</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>Albatross</td> +<td>2.99</td> +<td>On a stick!</td> +</tr> +<tr class="even"> +<td>Crunchy Frog</td> +<td>1.49</td> +<td>If we took the bones out, it wouldn't be crunchy, now would it?</td> +</tr> +<tr class="odd"> +<td>Gannet Ripple</td> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +``` + +List-table whose widths is "auto". + +``` +% pandoc -f rst +.. list-table:: Frozen Delights! + :header-rows: 1 + :widths: auto + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - On a stick! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +^D +<table> +<caption>Frozen Delights!</caption> +<thead> +<tr class="header"> +<th>Treat</th> +<th>Quantity</th> +<th>Description</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>Albatross</td> +<td>2.99</td> +<td>On a stick!</td> +</tr> +<tr class="even"> +<td>Crunchy Frog</td> +<td>1.49</td> +<td>If we took the bones out, it wouldn't be crunchy, now would it?</td> +</tr> +<tr class="odd"> +<td>Gannet Ripple</td> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +``` + + +List-table with header-rows which is bigger than 1. Only the first row is treated as a header. + +``` +% pandoc -f rst +.. list-table:: Frozen Delights! + :header-rows: 2 + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - On a stick! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +^D +<table> +<caption>Frozen Delights!</caption> +<thead> +<tr class="header"> +<th>Treat</th> +<th>Quantity</th> +<th>Description</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>Albatross</td> +<td>2.99</td> +<td>On a stick!</td> +</tr> +<tr class="even"> +<td>Crunchy Frog</td> +<td>1.49</td> +<td>If we took the bones out, it wouldn't be crunchy, now would it?</td> +</tr> +<tr class="odd"> +<td>Gannet Ripple</td> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +``` + +List-table without header-rows. + +``` +% pandoc -f rst +.. list-table:: Frozen Delights! + + * - Albatross + - 2.99 + - On a stick! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +^D +<table> +<caption>Frozen Delights!</caption> +<tbody> +<tr class="odd"> +<td>Albatross</td> +<td>2.99</td> +<td>On a stick!</td> +</tr> +<tr class="even"> +<td>Crunchy Frog</td> +<td>1.49</td> +<td>If we took the bones out, it wouldn't be crunchy, now would it?</td> +</tr> +<tr class="odd"> +<td>Gannet Ripple</td> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +``` + +List-table with empty cells. You need a space after '-', otherwise the row will disapear. Parser for Bulletlists causes this ristriction. + +``` +% pandoc -f rst +.. list-table:: Frozen Delights! + :header-rows: 2 + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - + * - Crunchy Frog + - + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +^D +<table> +<caption>Frozen Delights!</caption> +<thead> +<tr class="header"> +<th>Treat</th> +<th>Quantity</th> +<th>Description</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>Albatross</td> +<td>2.99</td> +<td></td> +</tr> +<tr class="even"> +<td>Crunchy Frog</td> +<td></td> +<td>If we took the bones out, it wouldn't be crunchy, now would it?</td> +</tr> +<tr class="odd"> +<td>Gannet Ripple</td> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +``` + +List-table with a cell having a bulletlist + +``` +% pandoc -f rst +.. list-table:: Frozen Delights! + + * - Albatross + - 2.99 + - + On a stick! + + In a cup! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! +^D +<table> +<caption>Frozen Delights!</caption> +<tbody> +<tr class="odd"> +<td>Albatross</td> +<td>2.99</td> +<td><ul> +<li>On a stick!</li> +<li>In a cup!</li> +</ul></td> +</tr> +<tr class="even"> +<td>Crunchy Frog</td> +<td>1.49</td> +<td>If we took the bones out, it wouldn't be crunchy, now would it?</td> +</tr> +<tr class="odd"> +<td>Gannet Ripple</td> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +``` diff --git a/test/command/3432a.md b/test/command/3432a.md new file mode 100644 index 000000000..5f25bce60 --- /dev/null +++ b/test/command/3432a.md @@ -0,0 +1,19 @@ +``` +% pandoc -f rst +* - a + - b +* - c + - d +^D +<ul> +<li><ul> +<li>a</li> +<li>b</li> +</ul></li> +<li><ul> +<li>c</li> +<li>d</li> +</ul></li> +</ul> +``` + diff --git a/test/command/3450.md b/test/command/3450.md new file mode 100644 index 000000000..5b35e1d9e --- /dev/null +++ b/test/command/3450.md @@ -0,0 +1,12 @@ +``` +% pandoc -fmarkdown-implicit_figures +![image](lalune.jpg){height=2em} +^D +<p><img src="lalune.jpg" alt="image" style="height:2em" /></p> +``` +``` +% pandoc -fmarkdown-implicit_figures -t latex +![image](lalune.jpg){height=2em} +^D +\includegraphics[width=\textwidth,height=2em]{lalune.jpg} +``` diff --git a/test/command/3475.md b/test/command/3475.md new file mode 100644 index 000000000..afba4ea3c --- /dev/null +++ b/test/command/3475.md @@ -0,0 +1,45 @@ +RST implicit internal links to headers: + +``` +pandoc -f rst +Years +----- + +Years_ +^D +<h1 id="years">Years</h1> +<p><a href="#years">Years</a></p> +``` + +``` +pandoc -f rst +Years_ + +Years +----- +^D +<p><a href="#years">Years</a></p> +<h1 id="years">Years</h1> +``` + +``` +pandoc -f rst +Years and years +--------------- + +`Years and years`_ +^D +<h1 id="years-and-years">Years and years</h1> +<p><a href="#years-and-years">Years and years</a></p> +``` + +``` +pandoc -f rst +Years and *years* +----------------- + +`Years and years`_ +^D +<h1 id="years-and-years">Years and <em>years</em></h1> +<p><a href="#years-and-years">Years and years</a></p> +``` diff --git a/test/command/3487.md b/test/command/3487.md new file mode 100644 index 000000000..1d475676f --- /dev/null +++ b/test/command/3487.md @@ -0,0 +1,11 @@ +``` +% pandoc -f html -t markdown +Some text +<ul> +<li>element</li> +</ul> +^D +Some text + +- element +``` diff --git a/test/command/3494.md b/test/command/3494.md new file mode 100644 index 000000000..249973fb3 --- /dev/null +++ b/test/command/3494.md @@ -0,0 +1,40 @@ +``` +% pandoc -f latex --quiet +\begin{table}[h!] +\begin{tabular}{r|l|l} + + {\large \textbf{ﺍ}} && \\ + \textbf{ﺄﺤﺴﻨﺘـ(ﻭﺍ) IV} & \em{ʾaḥsant(ū)} & thank you \\ + \newpage + \emph{blah} & \emph{blah} & \emph{blah} \\ + blah & blah & blah \\ + +\end{tabular} +\end{table} +^D +<table> +<tbody> +<tr class="odd"> +<td style="text-align: right;"><span><strong>ﺍ</strong></span></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +</tr> +<tr class="even"> +<td style="text-align: right;"><strong>ﺄﺤﺴﻨﺘـ(ﻭﺍ) IV</strong></td> +<td style="text-align: left;"><em><span>ʾaḥsant(ū)</span></em></td> +<td style="text-align: left;">thank you</td> +</tr> +<tr class="odd"> +<td style="text-align: right;"><p><em>blah</em></p></td> +<td style="text-align: left;"><em>blah</em></td> +<td style="text-align: left;"><em>blah</em></td> +</tr> +<tr class="even"> +<td style="text-align: right;">blah</td> +<td style="text-align: left;">blah</td> +<td style="text-align: left;">blah</td> +</tr> +</tbody> +</table> +``` + diff --git a/test/command/3497.md b/test/command/3497.md new file mode 100644 index 000000000..ca591cdd6 --- /dev/null +++ b/test/command/3497.md @@ -0,0 +1,51 @@ +Escape list markers at beginning of paragraph: + +``` +% pandoc -t markdown +\* ok + +\+ ok + +\- ok + +1\. ok + +a\. ok +^D +\* ok + +\+ ok + +\- ok + +1\. ok + +a\. ok +``` + +Here we don't need to escape because there's no space: + +``` +% pandoc -t markdown +\+ok + +\-ok + +1.ok +^D ++ok + +-ok + +1.ok +``` + +Also escape things that might become line blocks or tables: + +``` +% pandoc -t markdown +\| hi \| +^D +\| hi \| +``` + diff --git a/test/command/3499.md b/test/command/3499.md new file mode 100644 index 000000000..ba9f03589 --- /dev/null +++ b/test/command/3499.md @@ -0,0 +1,18 @@ +Org-mode tables can't be on the same line as list markers: +``` +% pandoc -f org +- |something| +- + |else| +^D +<ul> +<li>|something|</li> +<li><table> +<tbody> +<tr class="odd"> +<td>else</td> +</tr> +</tbody> +</table></li> +</ul> +``` diff --git a/test/command/3510-export.latex b/test/command/3510-export.latex new file mode 100644 index 000000000..6d8636322 --- /dev/null +++ b/test/command/3510-export.latex @@ -0,0 +1 @@ +\emph{Hello}
\ No newline at end of file diff --git a/test/command/3510-src.hs b/test/command/3510-src.hs new file mode 100644 index 000000000..ad5744b80 --- /dev/null +++ b/test/command/3510-src.hs @@ -0,0 +1 @@ +putStrLn outString diff --git a/test/command/3510-subdoc.org b/test/command/3510-subdoc.org new file mode 100644 index 000000000..5bcc6678a --- /dev/null +++ b/test/command/3510-subdoc.org @@ -0,0 +1,5 @@ +* Subsection + +Included text + +Lorem ipsum. diff --git a/test/command/3510.md b/test/command/3510.md new file mode 100644 index 000000000..7993db848 --- /dev/null +++ b/test/command/3510.md @@ -0,0 +1,20 @@ +See <http://orgmode.org/manual/Include-files.html> +``` +% pandoc -f org -t native +Text + +#+include: "command/3510-subdoc.org" + +#+INCLUDE: "command/3510-src.hs" src haskell +#+INCLUDE: "command/3510-export.latex" export latex + +More text +^D +[Para [Str "Text"] +,Header 1 ("subsection",[],[]) [Str "Subsection"] +,Para [Str "Included",Space,Str "text"] +,Plain [Str "Lorem",Space,Str "ipsum."] +,CodeBlock ("",["haskell"],[]) "putStrLn outString\n" +,RawBlock (Format "latex") "\\emph{Hello}" +,Para [Str "More",Space,Str "text"]] +``` diff --git a/test/command/3511.md b/test/command/3511.md new file mode 100644 index 000000000..b8bcedbb0 --- /dev/null +++ b/test/command/3511.md @@ -0,0 +1,46 @@ +``` +% pandoc -t native +- a + - b + - c + +- code + +1000. one + + not continuation +^D +[BulletList + [[Plain [Str "a"] + ,BulletList + [[Plain [Str "b"] + ,BulletList + [[Plain [Str "c"]]]]]] + ,[CodeBlock ("",[],[]) "code"]] +,OrderedList (1000,Decimal,Period) + [[Plain [Str "one"]]] +,CodeBlock ("",[],[]) "not continuation"] +``` + +``` +% pandoc -t native -f markdown+four_space_rule +- a + - b + - c + +- not code + +1000. one + + continuation +^D +[BulletList + [[Plain [Str "a"]] + ,[Plain [Str "b"] + ,BulletList + [[Plain [Str "c"]]]] + ,[CodeBlock ("",[],[]) "not code"]] +,OrderedList (1000,Decimal,Period) + [[Para [Str "one"] + ,Para [Str "continuation"]]]] +``` diff --git a/test/command/3512.md b/test/command/3512.md new file mode 100644 index 000000000..cf8c72e58 --- /dev/null +++ b/test/command/3512.md @@ -0,0 +1,13 @@ +``` +% pandoc -f markdown-auto_identifiers +#hi +^D +<p>#hi</p> +``` + +``` +% pandoc -f markdown-auto_identifiers-space_in_atx_header +#hi +^D +<h1>hi</h1> +``` diff --git a/test/command/3516.md b/test/command/3516.md new file mode 100644 index 000000000..8c7e478d3 --- /dev/null +++ b/test/command/3516.md @@ -0,0 +1,51 @@ +Correctly handle empty row: +``` +% pandoc -f markdown -t rst ++---+---+ +| 1 | 2 | ++---+---+ +| | | ++---+---+ +^D ++---+---+ +| 1 | 2 | ++---+---+ +| | | ++---+---+ +``` + +Temporarily added these to figure out what is happening +on Windows builds. +``` +% pandoc -f markdown -t native ++---+---+ +| 1 | 2 | ++---+---+ +| | | ++---+---+ +^D +[Table [] [AlignDefault,AlignDefault] [5.555555555555555e-2,5.555555555555555e-2] + [[] + ,[]] + [[[Plain [Str "1"]] + ,[Plain [Str "2"]]] + ,[[] + ,[]]]] +``` + +``` +% pandoc -f native -t rst +[Table [] [AlignDefault,AlignDefault] [5.555555555555555e-2,5.555555555555555e-2] + [[] + ,[]] + [[[Para [Str "1"]] + ,[Para [Str "2"]]] + ,[[] + ,[]]]] +^D ++---+---+ +| 1 | 2 | ++---+---+ +| | | ++---+---+ +``` diff --git a/test/command/3518.md b/test/command/3518.md new file mode 100644 index 000000000..ec3322192 --- /dev/null +++ b/test/command/3518.md @@ -0,0 +1,6 @@ +``` +pandoc -f latex -t plain +$\alpha^2 \cdot \alpha^{2+3} \equiv \alpha^7$ +^D +α² ⋅ α² ⁺ ³ ≡ α⁷ +``` diff --git a/test/command/3526.md b/test/command/3526.md new file mode 100644 index 000000000..e197bcf32 --- /dev/null +++ b/test/command/3526.md @@ -0,0 +1,14 @@ +``` +% pandoc -t rst ++--+---+ +| | | ++--+---+ +| | | ++--+---+ +^D ++---+---+ +| | | ++---+---+ +| | | ++---+---+ +``` diff --git a/test/command/3529.md b/test/command/3529.md new file mode 100644 index 000000000..fdf42f68e --- /dev/null +++ b/test/command/3529.md @@ -0,0 +1,15 @@ +``` +% pandoc -t markdown-simple_tables-pipe_tables-grid_tables+multiline_tables +A B +-- -- +7 8 +9 10 +^D + -------- + A B + --- ---- + 7 8 + + 9 10 + -------- +``` diff --git a/test/command/3530.md b/test/command/3530.md new file mode 100644 index 000000000..66393c856 --- /dev/null +++ b/test/command/3530.md @@ -0,0 +1,22 @@ +``` +% pandoc -f latex -t native +\subfile{command/sub-file-chapter-1} +\subfile{command/sub-file-chapter-2} +^D +[Header 1 ("chapter-1",[],[]) [Str "Chapter",Space,Str "1"] +,Para [Str "This",Space,Str "is",Space,Str "Chapter",Space,Str "1,",Space,Str "provided",Space,Str "in",Space,Str "a",Space,Str "sub",Space,Str "file."] +,Header 1 ("chapter-2",[],[]) [Str "Chapter",Space,Str "2"] +,Para [Str "This",Space,Str "is",Space,Str "Chapter",Space,Str "2,",Space,Str "provided",Space,Str "in",Space,Str "a",Space,Str "second",Space,Str "sub",Space,Str "file."]] +``` + +``` +% pandoc -flatex+raw_tex -t native +\subfile{command/sub-file-chapter-1} +\subfile{command/sub-file-chapter-2} +^D +[Header 1 ("chapter-1",[],[]) [Str "Chapter",Space,Str "1"] +,Para [Str "This",Space,Str "is",Space,Str "Chapter",Space,Str "1,",Space,Str "provided",Space,Str "in",Space,Str "a",Space,Str "sub",Space,Str "file."] +,Header 1 ("chapter-2",[],[]) [Str "Chapter",Space,Str "2"] +,Para [Str "This",Space,Str "is",Space,Str "Chapter",Space,Str "2,",Space,Str "provided",Space,Str "in",Space,Str "a",Space,Str "second",Space,Str "sub",Space,Str "file."]] + +``` diff --git a/test/command/3531.md b/test/command/3531.md new file mode 100644 index 000000000..2a4901a97 --- /dev/null +++ b/test/command/3531.md @@ -0,0 +1,21 @@ +``` +% pandoc -t mediawiki --wrap=preserve +* This is a list item. +* This is a list item in Markdown. It is + continued in the next line. + * It has a sub-item. +* This is the next list item. + +A paragraph can span multiple lines +without being broken into pieces. +^D +* This is a list item. +* This is a list item in Markdown. It is continued in the next line. +** It has a sub-item. +* This is the next list item. + +A paragraph can span multiple lines +without being broken into pieces. + + +``` diff --git a/test/command/3533-rst-csv-tables.csv b/test/command/3533-rst-csv-tables.csv new file mode 100644 index 000000000..efef5e4d5 --- /dev/null +++ b/test/command/3533-rst-csv-tables.csv @@ -0,0 +1,4 @@ +"Albatross", 2.99, "On a stick!" +"Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be +crunchy, now would it?" + diff --git a/test/command/3533-rst-csv-tables.md b/test/command/3533-rst-csv-tables.md new file mode 100644 index 000000000..181462f7f --- /dev/null +++ b/test/command/3533-rst-csv-tables.md @@ -0,0 +1,56 @@ +``` +% pandoc -f rst -t native +.. csv-table:: Test + :widths: 10, 5, 10 + :header: Flavor,Price,Slogan + :file: command/3533-rst-csv-tables.csv +^D +[Table [Str "Test"] [AlignDefault,AlignDefault,AlignDefault] [0.4,0.2,0.4] + [[Plain [Str "Flavor"]] + ,[Plain [Str "Price"]] + ,[Plain [Str "Slogan"]]] + [[[Plain [Str "Albatross"]] + ,[Plain [Str "2.99"]] + ,[Plain [Str "On",Space,Str "a",Space,Str "stick!"]]] + ,[[Plain [Str "Crunchy",Space,Str "Frog"]] + ,[Plain [Str "1.49"]] + ,[Plain [Str "If",Space,Str "we",Space,Str "took",Space,Str "the",Space,Str "bones",Space,Str "out,",Space,Str "it",Space,Str "wouldn't",Space,Str "be",SoftBreak,Str "crunchy,",Space,Str "now",Space,Str "would",Space,Str "it?"]]]]] +``` + +``` +% pandoc -f rst -t native +.. csv-table:: Test + :header-rows: 1 + :quote: ' + :delim: space + + '' 'a' 'b' + 'cat''s' 3 4 + 'dog''s' 2 3 +^D +[Table [Str "Test"] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0] + [[] + ,[Plain [Str "a"]] + ,[Plain [Str "b"]]] + [[[Plain [Str "cat's"]] + ,[Plain [Str "3"]] + ,[Plain [Str "4"]]] + ,[[Plain [Str "dog's"]] + ,[Plain [Str "2"]] + ,[Plain [Str "3"]]]]] +``` + +``` +% pandoc -f rst -t native +.. csv-table:: Test + :escape: \ + + "1","\"" +^D +[Table [Str "Test"] [AlignDefault,AlignDefault] [0.0,0.0] + [[] + ,[]] + [[[Plain [Str "1"]] + ,[Plain [Str "\""]]]]] +``` + diff --git a/test/command/3534.md b/test/command/3534.md new file mode 100644 index 000000000..89224551b --- /dev/null +++ b/test/command/3534.md @@ -0,0 +1,23 @@ +``` +% pandoc -f latex -t html +I want to explain the interface of \lstinline[language=Java]{public class MyClass}. +^D +<p>I want to explain the interface of <code class="sourceCode java"><span class="kw">public</span> <span class="kw">class</span> MyClass</code>.</p> + +``` + +``` +% pandoc -f latex -t html +I want to explain the interface of \lstinline{public class MyClass}. +^D +<p>I want to explain the interface of <code>public class MyClass</code>.</p> + +``` + +``` +% pandoc -f latex -t native +I want to explain the interface of \lstinline[language=Java]{public class MyClass}. +^D +[Para [Str "I",Space,Str "want",Space,Str "to",Space,Str "explain",Space,Str "the",Space,Str "interface",Space,Str "of",Space,Code ("",["java"],[]) "public class MyClass",Str "."]] +``` + diff --git a/test/command/3537.md b/test/command/3537.md new file mode 100644 index 000000000..df4eeba7d --- /dev/null +++ b/test/command/3537.md @@ -0,0 +1,28 @@ +Generalized raw attributes. + +```` +% pandoc -t native +```{=ms} +.MACRO +foo bar +``` +^D +[RawBlock (Format "ms") ".MACRO\nfoo bar"] +```` + +```` +% pandoc -t native +Hi `there`{=ms}. +^D +[Para [Str "Hi",Space,RawInline (Format "ms") "there",Str "."]] +```` + +```` +% pandoc -t native +~~~ {=ms} +.MACRO +foo bar +~~~ +^D +[RawBlock (Format "ms") ".MACRO\nfoo bar"] +```` diff --git a/test/command/3539.md b/test/command/3539.md new file mode 100644 index 000000000..6ef9ffac7 --- /dev/null +++ b/test/command/3539.md @@ -0,0 +1,45 @@ +# Commands of [glossaries package](ftp://ftp.tu-chemnitz.de/pub/tex/macros/latex/contrib/glossaries/glossaries-code.pdf) + +``` +% pandoc -f latex -t native +Many programming languages provide \glspl{API}. Each \gls{API} should provide a documentation. +^D +[Para [Str "Many",Space,Str "programming",Space,Str "languages",Space,Str "provide",Space,Span ("",[],[("acronym-label","API"),("acronym-form","plural+short")]) [Str "APIs"],Str ".",Space,Str "Each",Space,Span ("",[],[("acronym-label","API"),("acronym-form","singular+short")]) [Str "API"],Space,Str "should",Space,Str "provide",Space,Str "a",Space,Str "documentation."]] +``` + +``` +% pandoc -f latex -t native +\Glsdesc{API} XYZ ist not as performant as \glsdesc{API} ZXY. +^D +[Para [Span ("",[],[("acronym-label","API"),("acronym-form","singular+long")]) [Str "API"],Space,Str "XYZ",Space,Str "ist",Space,Str "not",Space,Str "as",Space,Str "performant",Space,Str "as",Space,Span ("",[],[("acronym-label","API"),("acronym-form","singular+long")]) [Str "API"],Space,Str "ZXY."]] +``` + +``` +% pandoc -f latex -t native +\Acrlong{API} XYZ ist not as performant as \acrlong{API} ZXY. +^D +[Para [Span ("",[],[("acronym-label","API"),("acronym-form","singular+long")]) [Str "API"],Space,Str "XYZ",Space,Str "ist",Space,Str "not",Space,Str "as",Space,Str "performant",Space,Str "as",Space,Span ("",[],[("acronym-label","API"),("acronym-form","singular+long")]) [Str "API"],Space,Str "ZXY."]] +``` + +``` +% pandoc -f latex -t native +\Acrfull{API} XYZ ist not as performant as \acrfull{API} ZXY. +^D +[Para [Span ("",[],[("acronym-label","API"),("acronym-form","singular+full")]) [Str "API"],Space,Str "XYZ",Space,Str "ist",Space,Str "not",Space,Str "as",Space,Str "performant",Space,Str "as",Space,Span ("",[],[("acronym-label","API"),("acronym-form","singular+full")]) [Str "API"],Space,Str "ZXY."]] +``` + +``` +% pandoc -f latex -t native +\Acrshort{API} XYZ ist not as performant as \acrshort{API} ZXY. +^D +[Para [Span ("",[],[("acronym-label","API"),("acronym-form","singular+abbrv")]) [Str "API"],Space,Str "XYZ",Space,Str "ist",Space,Str "not",Space,Str "as",Space,Str "performant",Space,Str "as",Space,Span ("",[],[("acronym-label","API"),("acronym-form","singular+abbrv")]) [Str "API"],Space,Str "ZXY."]] +``` + +# Commands of [acronym package](ftp://ftp.mpi-sb.mpg.de/pub/tex/mirror/ftp.dante.de/pub/tex/macros/latex/contrib/acronym/acronym.pdf) + +``` +% pandoc -f latex -t native +Many programming languages provide \acp{API}. Each \ac{API} should provide a documentation. +^D +[Para [Str "Many",Space,Str "programming",Space,Str "languages",Space,Str "provide",Space,Span ("",[],[("acronym-label","API"),("acronym-form","plural+short")]) [Str "APIs"],Str ".",Space,Str "Each",Space,Span ("",[],[("acronym-label","API"),("acronym-form","singular+short")]) [Str "API"],Space,Str "should",Space,Str "provide",Space,Str "a",Space,Str "documentation."]] +``` diff --git a/test/command/3558.md b/test/command/3558.md new file mode 100644 index 000000000..795858b78 --- /dev/null +++ b/test/command/3558.md @@ -0,0 +1,12 @@ +``` +% pandoc -t native +\multi + +hello + +\endmulti +^D +[RawBlock (Format "latex") "\\multi" +,Para [Str "hello"] +,RawBlock (Format "latex") "\\endmulti"] +``` diff --git a/test/command/3568.md b/test/command/3568.md new file mode 100644 index 000000000..e77c27b78 --- /dev/null +++ b/test/command/3568.md @@ -0,0 +1,15 @@ +``` +% pandoc -t man +normal *italic **bold in the middle** only italic* normal. + +normal **bold `code` more bold** normal. + +normal `code` normal. +^D +.PP +normal \f[I]italic \f[BI]bold in the middle\f[I] only italic\f[] normal. +.PP +normal \f[B]bold \f[BC]code\f[B] more bold\f[] normal. +.PP +normal \f[C]code\f[] normal. +``` diff --git a/test/command/3570.md b/test/command/3570.md new file mode 100644 index 000000000..8c08a881d --- /dev/null +++ b/test/command/3570.md @@ -0,0 +1,6 @@ +``` +% pandoc -f markdown+autolink_bare_uris +**Notes:** +^D +<p><strong>Notes:</strong></p> +``` diff --git a/test/command/3577.md b/test/command/3577.md new file mode 100644 index 000000000..ca9dba97c --- /dev/null +++ b/test/command/3577.md @@ -0,0 +1,37 @@ +``` +% pandoc -f latex -t html5 --quiet +\begin{figure}[ht] + \begin{subfigure}{0.45\textwidth} + \centering + \includegraphics{img1.jpg} + \caption{Caption 1} + \end{subfigure} + + \begin{subfigure}{0.45\textwidth} + \centering + \includegraphics{img2.jpg} + \caption{Caption 2} + \end{subfigure} + \caption{Subfigure with Subfloat} +\end{figure} +^D + +<figure> +<img src="img1.jpg" alt="Caption 1" /><figcaption>Caption 1</figcaption> +</figure> + +<figure> +<img src="img2.jpg" alt="Caption 2" /><figcaption>Caption 2</figcaption> +</figure> +``` +``` +% pandoc -f latex -t html5 +\begin{figure}[ht] + \includegraphics{img1.jpg} + \caption{Caption 3} +\end{figure} +^D +<figure> +<img src="img1.jpg" alt="Caption 3" /><figcaption>Caption 3</figcaption> +</figure> +``` diff --git a/test/command/3585.md b/test/command/3585.md new file mode 100644 index 000000000..739ddeea4 --- /dev/null +++ b/test/command/3585.md @@ -0,0 +1,16 @@ +``` +% pandoc -f mediawiki+smart -t native +"Hello" + +Same but bzip2 it and nice it <tt>zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org "> /storage/c-3po/tank-storage-data-svn.dmp.bz2"</tt> +^D +[Para [Quoted DoubleQuote [Str "Hello"]] +,Para [Str "Same",Space,Str "but",Space,Str "bzip2",Space,Str "it",Space,Str "and",Space,Str "nice",Space,Str "it",Space,Code ("",[],[]) "zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org \"> /storage/c-3po/tank-storage-data-svn.dmp.bz2\""]] +``` + +``` +% pandoc -f mediawiki -t native +"Hello" +^D +[Para [Str "\"Hello\""]] +``` diff --git a/test/command/3587.md b/test/command/3587.md new file mode 100644 index 000000000..addb6c582 --- /dev/null +++ b/test/command/3587.md @@ -0,0 +1,21 @@ +``` +% pandoc -f latex -t native +\SI[round-precision=2]{1}{m} is equal to \SI{1000}{mm} +^D +[Para [Str "1\160m",Space,Str "is",Space,Str "equal",Space,Str "to",Space,Str "1000\160mm"]] +``` + +``` +% pandoc -f latex -t native +\SI[round-precision=2]{1}[\$]{} is equal to \SI{0.938094}{\euro} +^D +[Para [Str "$\160\&1",Space,Str "is",Space,Str "equal",Space,Str "to",Space,Str "0.938094\160\8364"]] +``` + + +``` +% pandoc -f latex -t native +\SI[round-precision=2]{\{\}}[\{\}]{\{\}} +^D +[Para [Str "{}\160{}\160{}"]] +``` diff --git a/test/command/3596.md b/test/command/3596.md new file mode 100644 index 000000000..01a871e1b --- /dev/null +++ b/test/command/3596.md @@ -0,0 +1,59 @@ +``` +% pandoc -f html -t markdown-raw_html-bracketed_spans-native_spans +<ul> +<li>foo</li> +<li id="id">bar</li> +<li>baz</li> +</ul> +^D +- foo +- bar +- baz +``` + +``` +% pandoc -f html -t markdown-raw_html-bracketed_spans-native_spans +<ul> +<li>foo</li> +<li id="id">bar<ul><li>subbar</li></ul></li> +<li>baz</li> +</ul> +^D +- foo +- bar + - subbar +- baz +``` + + +``` +% pandoc -f html -t markdown +<ul> +<li>foo</li> +<li id="id">bar</li> +<li>baz</li> +</ul> +^D +- foo +- [bar]{#id} +- baz +``` + + +``` +% pandoc -f html -t markdown +<ul> +<li><p>foo</p></li> +<li id="id"><p>bar</p></li> +<li><p>baz</p></li> +</ul> +^D +- foo + +- ::: {#id} + bar + ::: + +- baz + +``` diff --git a/test/command/3615.md b/test/command/3615.md new file mode 100644 index 000000000..5fbd48b3a --- /dev/null +++ b/test/command/3615.md @@ -0,0 +1,18 @@ +``` +% pandoc -f html -t markdown --reference-links +<a href="a">foo</a> <a href="b">Foo</a> +^D +[foo][] [Foo][1] + + [foo]: a + [1]: b +``` + +``` +% pandoc -f html -t markdown --reference-links +<a href="a">foo</a> <a href="a">Foo</a> +^D +[foo][] [Foo] + + [foo]: a +``` diff --git a/test/command/3619.md b/test/command/3619.md new file mode 100644 index 000000000..62962c43b --- /dev/null +++ b/test/command/3619.md @@ -0,0 +1,28 @@ +``` +% pandoc -f html -t markdown --reference-links +<a href="foo">bar</a>: baz +^D +[bar][]: baz + + [bar]: foo +``` + +``` +% pandoc -f html -t markdown --reference-links +<a href="foo">bar</a>(baz) +^D +[bar][](baz) + + [bar]: foo +``` + +``` +% pandoc -f html -t markdown_strict --reference-links +<a href="a">foo</a><br/><a href="b">bar</a> +^D +[foo][] +[bar] + + [foo]: a + [bar]: b +``` diff --git a/test/command/3630.md b/test/command/3630.md new file mode 100644 index 000000000..db3a17dda --- /dev/null +++ b/test/command/3630.md @@ -0,0 +1,8 @@ +``` +% pandoc -f markdown -t markdown --reference-links +![foo](bar.png){#myId} +^D +![foo] + + [foo]: bar.png {#myId} +``` diff --git a/test/command/3667.md b/test/command/3667.md new file mode 100644 index 000000000..97de8f598 --- /dev/null +++ b/test/command/3667.md @@ -0,0 +1,13 @@ +``` +% pandoc -f textile +| "link text":http://example.com/ | +^D +<table> +<tbody> +<tr class="odd"> +<td><a href="http://example.com/">link text</a></td> +</tr> +</tbody> +</table> +``` + diff --git a/test/command/3674.md b/test/command/3674.md new file mode 100644 index 000000000..92ed4bed7 --- /dev/null +++ b/test/command/3674.md @@ -0,0 +1,39 @@ +Make sure we don't get duplicate reference links, even with +`--reference-location=section`. + +``` +% pandoc --reference-links -t markdown --reference-location=section --atx-headers +# a + +![](a) + +# b + +![](b) + +^D +# a + +![][1] + + [1]: a + +# b + +![][2] + + [2]: b +``` + +Subsidiary issue: allow line break between reference link +url/title and attributes: + +``` +% pandoc +[a] + +[a]: url +{.class} +^D +<p><a href="url" class="class">a</a></p> +``` diff --git a/test/command/3675.md b/test/command/3675.md new file mode 100644 index 000000000..b129c7a63 --- /dev/null +++ b/test/command/3675.md @@ -0,0 +1,15 @@ +```` +% pandoc -t rst +```python +print("hello") +``` +> block quote +^D +.. code:: python + + print("hello") + +.. + + block quote +```` diff --git a/test/command/3681.md b/test/command/3681.md new file mode 100644 index 000000000..d0805e820 --- /dev/null +++ b/test/command/3681.md @@ -0,0 +1,27 @@ +``` +% pandoc -f latex -t native +\newcommand{\cicd}{CI/CD\xspace} + +Software developers create \cicd pipelines to… Following issue can be resolved by \cicd: +^D +[Para [Str "Software",Space,Str "developers",Space,Str "create",Space,Str "CI/CD",Space,Str "pipelines",Space,Str "to\8230",Space,Str "Following",Space,Str "issue",Space,Str "can",Space,Str "be",Space,Str "resolved",Space,Str "by",Space,Str "CI/CD:"]] +``` + +``` +% pandoc -f latex -t native +\newcommand{\cicd}{CI/CD\xspace} + +\cicd\footnote{\url{https://en.wikipedia.org/wiki/CI/CD}} is awesome. +^D +[Para [Str "CI/CD",Note [Para [Link ("",[],[]) [Str "https://en.wikipedia.org/wiki/CI/CD"] ("https://en.wikipedia.org/wiki/CI/CD","")]],Space,Str "is",Space,Str "awesome."]] +``` + +``` +% pandoc -f latex -t native +\newcommand{\cicd}{CI/CD\xspace} +\newcommand{\pipeline}{pipeline\xspace} + +\cicd\pipeline. +^D +[Para [Str "CI/CD",Space,Str "pipeline."]] +``` diff --git a/test/command/3690.md b/test/command/3690.md new file mode 100644 index 000000000..213b88138 --- /dev/null +++ b/test/command/3690.md @@ -0,0 +1,8 @@ +``` +% pandoc +- [o] _hi_ +^D +<ul> +<li>[o] <em>hi</em></li> +</ul> +``` diff --git a/test/command/3701.md b/test/command/3701.md new file mode 100644 index 000000000..01e438639 --- /dev/null +++ b/test/command/3701.md @@ -0,0 +1,60 @@ +``` +% pandoc --reference-location=block -t markdown --reference-links --wrap=preserve +[a](u) + +[a](u) + +[a](u2) +[A](u) +[a](u){.foo} + +[a](u3) +^D +[a] + + [a]: u + +[a] + + [a]: u + +[a][1] +[A][] +[a][2] + + [1]: u2 + [A]: u + [2]: u {.foo} + +[a][3] + + [3]: u3 +``` + +``` +% pandoc +[a] + + [a]: u + +[a] + + [a]: u + +[a][1] +[A][] +[a][2] + + [1]: u2 + [A]: u + [2]: u {.foo} + +[a][3] + + [3]: u3 +^D +<p><a href="u">a</a></p> +<p><a href="u">a</a></p> +<p><a href="u2">a</a> <a href="u">A</a> <a href="u" class="foo">a</a></p> +<p><a href="u3">a</a></p> +``` diff --git a/test/command/3706.md b/test/command/3706.md new file mode 100644 index 000000000..00f53279e --- /dev/null +++ b/test/command/3706.md @@ -0,0 +1,44 @@ +Results marker can be hidden in block attributes (#3706) + +``` +pandoc -f org -t native +#+BEGIN_SRC R :exports results :colnames yes + data.frame(Id = 1:3, Desc = rep("La",3)) +#+END_SRC + +#+CAPTION: Lalelu. +#+LABEL: tab +#+RESULTS: +| Id | Desc | +|----+------| +| 1 | La | +| 2 | La | +| 3 | La | +^D +[Table [Str "Lalelu."] [AlignDefault,AlignDefault] [0.0,0.0] + [[Plain [Str "Id"]] + ,[Plain [Str "Desc"]]] + [[[Plain [Str "1"]] + ,[Plain [Str "La"]]] + ,[[Plain [Str "2"]] + ,[Plain [Str "La"]]] + ,[[Plain [Str "3"]] + ,[Plain [Str "La"]]]]] +``` + +``` +pandoc -f org -t native +#+BEGIN_SRC R :exports none :colnames yes + data.frame(Id = 1:2, Desc = rep("La",2)) +#+END_SRC + +#+CAPTION: Lalelu. +#+LABEL: tab +#+RESULTS: +| Id | Desc | +|----+------| +| 1 | La | +| 2 | La | +^D +[] +``` diff --git a/test/command/3708.md b/test/command/3708.md new file mode 100644 index 000000000..2cbc82c25 --- /dev/null +++ b/test/command/3708.md @@ -0,0 +1,15 @@ +``` +% pandoc -f latex -t native +\begin{tabular}{cc} + A & B\&1 \\ + C & D +\end{tabular} +^D +[Table [] [AlignCenter,AlignCenter] [0.0,0.0] + [[] + ,[]] + [[[Plain [Str "A"]] + ,[Plain [Str "B&1"]]] + ,[[Plain [Str "C"]] + ,[Plain [Str "D"]]]]] +``` diff --git a/test/command/3715.md b/test/command/3715.md new file mode 100644 index 000000000..9d74779cb --- /dev/null +++ b/test/command/3715.md @@ -0,0 +1,15 @@ +``` +% pandoc -t markdown -f html --wrap=preserve +x<em></em>x +y<strong></strong>y +z<sup></sup>z +w<sub></sub>w +q<s></s>q +^D +xx +yy +zz +ww +qq +``` + diff --git a/test/command/3716.md b/test/command/3716.md new file mode 100644 index 000000000..7e00819da --- /dev/null +++ b/test/command/3716.md @@ -0,0 +1,6 @@ +``` +% pandoc +<http://example.com>{.foo} +^D +<p><a href="http://example.com" class="uri foo">http://example.com</a></p> +``` diff --git a/test/command/3730.md b/test/command/3730.md new file mode 100644 index 000000000..fbc06cbce --- /dev/null +++ b/test/command/3730.md @@ -0,0 +1,21 @@ +```` +% pandoc +nice line\ +``` +code +``` +^D +<p>nice line<br /> +</p> +<pre><code>code</code></pre> +```` + +``` +% pandoc +# hi\ +there +^D +<h1 id="hi">hi<br /> +</h1> +<p>there</p> +``` diff --git a/test/command/3733.md b/test/command/3733.md new file mode 100644 index 000000000..b8a326938 --- /dev/null +++ b/test/command/3733.md @@ -0,0 +1,13 @@ +```` +% pandoc -t native +- Item1 +- Item2 +```yaml +some: code +``` +^D +[BulletList + [[Plain [Str "Item1"]] + ,[Plain [Str "Item2"]]] +,CodeBlock ("",["yaml"],[]) "some: code"] +```` diff --git a/test/command/3734.md b/test/command/3734.md new file mode 100644 index 000000000..16803256b --- /dev/null +++ b/test/command/3734.md @@ -0,0 +1,50 @@ +``` +% pandoc -t markdown_strict+pipe_tables +| aaaaaaaaaaaa | bbbbb | ccccccccccc | +|--------------|-------|--------------------------------------------------------------------------| +| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc | +^D +<table> +<colgroup> +<col style="width: 14%" /> +<col style="width: 7%" /> +<col style="width: 77%" /> +</colgroup> +<thead> +<tr class="header"> +<th>aaaaaaaaaaaa</th> +<th>bbbbb</th> +<th>ccccccccccc</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td>aaaaaaaaaaaa</td> +<td></td> +<td>cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc</td> +</tr> +</tbody> +</table> +``` + +``` +% pandoc -t markdown_strict+pipe_tables-raw_html +| aaaaaaaaaaaa | bbbbb | ccccccccccc | +|--------------|-------|--------------------------------------------------------------------------| +| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc | +^D +| aaaaaaaaaaaa | bbbbb | ccccccccccc | +|--------------|-------|--------------------------------------------------------------------------| +| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc | +``` + +``` +% pandoc -t gfm +| aaaaaaaaaaaa | bbbbb | ccccccccccc | +|--------------|-------|--------------------------------------------------------------------------| +| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc | +^D +| aaaaaaaaaaaa | bbbbb | ccccccccccc | +| ------------ | ----- | ------------------------------------------------------------------------ | +| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc | +``` diff --git a/test/command/3736.md b/test/command/3736.md new file mode 100644 index 000000000..b66e0a359 --- /dev/null +++ b/test/command/3736.md @@ -0,0 +1,25 @@ +``` +% pandoc --wrap=preserve -f html -t markdown +<h2>hi +there</h2> +^D +hi there +-------- +``` + +``` +% pandoc --wrap=preserve -f html -t markdown +<h2>hi <em>there +again</em></h2> +^D +hi *there again* +---------------- +``` + +``` +% pandoc --wrap=preserve -f html -t markdown +<h2>hi<br>there</h2> +^D +hi there +-------- +``` diff --git a/test/command/3755.md b/test/command/3755.md new file mode 100644 index 000000000..5e1ffc921 --- /dev/null +++ b/test/command/3755.md @@ -0,0 +1,23 @@ +``` +% pandoc -t native -s +--- +title: 'Titel' +date: '22. Juni 2017' +--- +^D +Pandoc (Meta {unMeta = fromList [("date",MetaInlines [Str "22.",Space,Str "Juni",Space,Str "2017"]),("title",MetaInlines [Str "Titel"])]}) +[] +``` + +``` +% pandoc -t native -s +--- +title: '<div>foo</div>' +date: | + 22. Juni 2017 +--- +^D +Pandoc (Meta {unMeta = fromList [("date",MetaBlocks [OrderedList (22,Decimal,Period) [[Plain [Str "Juni",Space,Str "2017"]]]]),("title",MetaBlocks [Div ("",[],[]) [Plain [Str "foo"]]])]}) +[] +``` + diff --git a/test/command/3771.md b/test/command/3771.md new file mode 100644 index 000000000..1d3a75ae1 --- /dev/null +++ b/test/command/3771.md @@ -0,0 +1,14 @@ +``` +% pandoc -f html -t org +<div class="Section1"> + Today is a nice day. +</div> +<div id="forecast"> + Tomorrow will be rainy. +</div> +^D +Today is a nice day. + +<<forecast>> +Tomorrow will be rainy. +``` diff --git a/test/command/3773.md b/test/command/3773.md new file mode 100644 index 000000000..7ee8a3941 --- /dev/null +++ b/test/command/3773.md @@ -0,0 +1,14 @@ +``` +% pandoc -t markdown +A. \# +B. \+ +C. \* +D. o +E. o or \* +^D +A. \# +B. \+ +C. \* +D. o +E. o or \* +``` diff --git a/test/command/3779.md b/test/command/3779.md new file mode 100644 index 000000000..1097123f0 --- /dev/null +++ b/test/command/3779.md @@ -0,0 +1,28 @@ +``` +% pandoc -f latex -t native +\newcommand{\fakeitemize}[1]{ + \begin{itemize} + #1 + \end{itemize} +} +\newcommand{\testcmd}[1]{ + #1 +} +\fakeitemize{ + \item Pandoc is 100\% awesome. +} + +\begin{itemize} + \item Pandoc is 200\% awesome. +\end{itemize} + +\testcmd{ + Pandoc is 300\% awesome. +} +^D +[BulletList + [[Para [Str "Pandoc",Space,Str "is",Space,Str "100%",Space,Str "awesome."]]] +,BulletList + [[Para [Str "Pandoc",Space,Str "is",Space,Str "200%",Space,Str "awesome."]]] +,Para [Str "Pandoc",Space,Str "is",Space,Str "300%",Space,Str "awesome."]] +``` diff --git a/test/command/3792.md b/test/command/3792.md new file mode 100644 index 000000000..7c76afee7 --- /dev/null +++ b/test/command/3792.md @@ -0,0 +1,13 @@ +Make sure metadata values are treated as strings, +and properly escaped. + +``` +% pandoc -t markdown -s -M title="<this> *that*" +ok +^D +--- +title: '\<this\> \*that\*' +--- + +ok +``` diff --git a/test/command/3794.md b/test/command/3794.md new file mode 100644 index 000000000..b56e7b504 --- /dev/null +++ b/test/command/3794.md @@ -0,0 +1,7 @@ +``` +% pandoc -f html -t native +<div><p>hello</div> +^D +[Div ("",[],[]) + [Para [Str "hello"]]] +``` diff --git a/test/command/3803.md b/test/command/3803.md new file mode 100644 index 000000000..a2e60359d --- /dev/null +++ b/test/command/3803.md @@ -0,0 +1,10 @@ +``` +% pandoc -f markdown+raw_tex -t latex +\begin{blah*} +*ok* +\end{blah*} +^D +\begin{blah*} +*ok* +\end{blah*} +``` diff --git a/test/command/3804.md b/test/command/3804.md new file mode 100644 index 000000000..c13c2ef42 --- /dev/null +++ b/test/command/3804.md @@ -0,0 +1,6 @@ +``` +% pandoc -t native +\titleformat{\chapter}[display]{\normalfont\large\bfseries}{第\thechapter{}章}{20pt}{\Huge} +^D +[RawBlock (Format "latex") "\\titleformat{\\chapter}[display]{\\normalfont\\large\\bfseries}{\31532\\thechapter{}\31456}{20pt}{\\Huge}"] +``` diff --git a/test/command/3816.md b/test/command/3816.md new file mode 100644 index 000000000..3979ea9ab --- /dev/null +++ b/test/command/3816.md @@ -0,0 +1,32 @@ +``` +% pandoc --mathjax -t html5 --wrap=preserve +This is an equation: +\begin{equation} +y+2 = 3 +\end{equation} + +This is a system of equations: +\begin{align*} +x^2+y^2 & = 2 \\ +\sin(y) & = 0.5 +\end{align*} + +This is Euler's formula: +\begin{eqnarray*} +e^{i\pi} + 1 & = & 0. +\end{eqnarray*} +^D +<p>This is an equation: +<span class="math display">\[\begin{equation} +y+2 = 3 +\end{equation}\]</span></p> +<p>This is a system of equations: +<span class="math display">\[\begin{align*} +x^2+y^2 & = 2 \\ +\sin(y) & = 0.5 +\end{align*}\]</span></p> +<p>This is Euler’s formula: +<span class="math display">\[\begin{eqnarray*} +e^{i\pi} + 1 & = & 0. +\end{eqnarray*}\]</span></p> +``` diff --git a/test/command/3824.md b/test/command/3824.md new file mode 100644 index 000000000..e479e9e2f --- /dev/null +++ b/test/command/3824.md @@ -0,0 +1,14 @@ +``` +% pandoc -f native -t dokuwiki +[BulletList + [[Para [Str "hi"] + ,CodeBlock ("",[],[]) " there"] + ,[Para [Str "ok"]]]] +^D + * hi<code> + there +</code> + * ok + + +``` diff --git a/test/command/3840.md b/test/command/3840.md new file mode 100644 index 000000000..ceb1d1e51 --- /dev/null +++ b/test/command/3840.md @@ -0,0 +1,15 @@ +``` +% pandoc +[@Alhazen1572-qk, V.9]: "competentius est" +^D +<p><span class="citation" data-cites="Alhazen1572-qk">[@Alhazen1572-qk, V.9]</span>: “competentius est”</p> +``` + +``` +% pandoc -f markdown-citations +[@Alhazen1572-qk, V.9]: "competentius est" + +[@Alhazen1572-qk, V.9] +^D +<p><a href="" title="competentius est">@Alhazen1572-qk, V.9</a></p> +``` diff --git a/test/command/3853.md b/test/command/3853.md new file mode 100644 index 000000000..19e8e2260 --- /dev/null +++ b/test/command/3853.md @@ -0,0 +1,26 @@ +``` +% pandoc -f latex -t native +\newtoggle{ebook} +\toggletrue{ebook} +\iftoggle{ebook}{ +ebook +}% +{ +not ebook +}% +more + +\togglefalse{ebook} +\iftoggle{ebook}{% +ebook +}{ +not ebook +}% +more + +hello \iftoggle{ebook}{ebook}{noebook} +^D +[Para [Str "ebook",SoftBreak,Str "more"] +,Para [Str "not",Space,Str "ebook",SoftBreak,Str "more"] +,Para [Str "hello",Space,Str "noebook"]] +``` diff --git a/test/command/3880.md b/test/command/3880.md new file mode 100644 index 000000000..b8edaf08f --- /dev/null +++ b/test/command/3880.md @@ -0,0 +1,6 @@ +``` +pandoc -f rst -t native +.. include:: command/3880.txt +^D +[Para [Str "hi"]] +``` diff --git a/test/command/3880.txt b/test/command/3880.txt new file mode 100644 index 000000000..45b983be3 --- /dev/null +++ b/test/command/3880.txt @@ -0,0 +1 @@ +hi diff --git a/test/command/3916.md b/test/command/3916.md new file mode 100644 index 000000000..9ac0834d7 --- /dev/null +++ b/test/command/3916.md @@ -0,0 +1,11 @@ +``` +% pandoc -f textile -t native +# text text +<pre>blabla</pre> +# more +^D +[OrderedList (1,DefaultStyle,DefaultDelim) + [[Plain [Str "text",Space,Str "text"] + ,CodeBlock ("",[],[]) "blabla"] + ,[Plain [Str "more"]]]] +``` diff --git a/test/command/3937.md b/test/command/3937.md new file mode 100644 index 000000000..2f32cd172 --- /dev/null +++ b/test/command/3937.md @@ -0,0 +1,13 @@ +``` +% pandoc -t rst +# My Great Section {#mysection} +# Other section +^D +.. _mysection: + +My Great Section +================ + +Other section +============= +``` diff --git a/test/command/3947.md b/test/command/3947.md new file mode 100644 index 000000000..7ce0be171 --- /dev/null +++ b/test/command/3947.md @@ -0,0 +1,11 @@ +``` +% pandoc -t native +\newpage + + Code block + + Another Code block +^D +[RawBlock (Format "latex") "\\newpage" +,CodeBlock ("",[],[]) "Code block\n\nAnother Code block"] +``` diff --git a/test/command/3958.md b/test/command/3958.md new file mode 100644 index 000000000..1793dd05c --- /dev/null +++ b/test/command/3958.md @@ -0,0 +1,20 @@ +``` +% pandoc -f latex -t native +\texttt{"hi"} +^D +[Para [Code ("",[],[]) "\"hi\""]] +``` + +``` +% pandoc -f latex -t native +\texttt{``hi''} +^D +[Para [Code ("",[],[]) "\8220hi\8221"]] +``` + +``` +% pandoc -f latex -t native +\texttt{`hi'} +^D +[Para [Code ("",[],[]) "\8216hi\8217"]] +``` diff --git a/test/command/3968.md b/test/command/3968.md new file mode 100644 index 000000000..c76cfcba4 --- /dev/null +++ b/test/command/3968.md @@ -0,0 +1,10 @@ +``` +% pandoc --top-level-division=chapter -t context +# Chapter + +## Section +^D +\chapter[title={Chapter},reference={chapter}] + +\section[title={Section},reference={section}] +``` diff --git a/test/command/3971.md b/test/command/3971.md new file mode 100644 index 000000000..533540743 --- /dev/null +++ b/test/command/3971.md @@ -0,0 +1,9 @@ +``` +% pandoc -f latex -t native +\documentclass{article} +\include{command/3971b} +\code{f} +\end{document} +^D +[Para [Code ("",[],[]) "f"]] +``` diff --git a/test/command/3971b.tex b/test/command/3971b.tex new file mode 100644 index 000000000..0d1dc3e02 --- /dev/null +++ b/test/command/3971b.tex @@ -0,0 +1,2 @@ +\newcommand{\code}[1]{\texttt{#1}} +\begin{document} diff --git a/test/command/3974.md b/test/command/3974.md new file mode 100644 index 000000000..26ab36688 --- /dev/null +++ b/test/command/3974.md @@ -0,0 +1,6 @@ +``` +% pandoc -f native -t rst +[Code ("",[],[]) "``"] +^D +:literal:`\`\`` +``` diff --git a/test/command/3978.md b/test/command/3978.md new file mode 100644 index 000000000..2399ae6e6 --- /dev/null +++ b/test/command/3978.md @@ -0,0 +1,6 @@ +``` +% pandoc -t rst +foo_bar*baz +^D +foo_bar*baz +``` diff --git a/test/command/3983.md b/test/command/3983.md new file mode 100644 index 000000000..7eaeb99f0 --- /dev/null +++ b/test/command/3983.md @@ -0,0 +1,29 @@ +``` +pandoc -f latex -t native +\def\filename@area{foo:bar:baz} +\makeatletter +\graphicspath\expandafter{\expandafter{\filename@area}}% +\makeatother +^D +[RawBlock (Format "latex") "\\makeatletter" +,RawBlock (Format "latex") "\\makeatother"] +``` + +``` +pandoc -f latex -t native +\makeatletter + \newcommand\urlfootnote@[1]{\footnote{\url@{#1}}} + \DeclareRobustCommand{\urlfootnote}{\hyper@normalise\urlfootnote@} +\makeatother +^D +[RawBlock (Format "latex") "\\makeatletter" +,RawBlock (Format "latex") "\\makeatother"] +``` + +``` +pandoc -f latex -t native +\def\foo{bar} +\expandafter\bam\foo +^D +[RawBlock (Format "latex") "\\bambar"] +``` diff --git a/test/command/3989.md b/test/command/3989.md new file mode 100644 index 000000000..bf078b2e4 --- /dev/null +++ b/test/command/3989.md @@ -0,0 +1,7 @@ +``` +pandoc -f markdown -t native +<span title="1st line of text <br> 2nd line of text">foo</span> + <span title="1st line of text <br> 2nd line of text">foo</span> +^D +[Para [Span ("",[],[("title","1st line of text <br> 2nd line of text")]) [Str "foo"],SoftBreak,Span ("",[],[("title","1st line of text <br> 2nd line of text")]) [Str "foo"]]] +``` diff --git a/test/command/4007.md b/test/command/4007.md new file mode 100644 index 000000000..c6064e0f2 --- /dev/null +++ b/test/command/4007.md @@ -0,0 +1,23 @@ +``` +pandoc -f latex -t native +\newcommand\arrow\to +$a\arrow b$ +^D +[Para [Math InlineMath "a\\to b"]] +``` + +``` +pandoc -f latex -t native +\newcommand\pfeil[1]{\to #1} +$a\pfeil b$ +^D +[Para [Math InlineMath "a\\to b"]] +``` + +``` +pandoc -f latex -t native +\newcommand\fleche{\to} +$a\fleche b$ +^D +[Para [Math InlineMath "a\\to b"]] +``` diff --git a/test/command/4012.md b/test/command/4012.md new file mode 100644 index 000000000..579ee2459 --- /dev/null +++ b/test/command/4012.md @@ -0,0 +1,8 @@ +``` +pandoc -f markdown-implicit_figures +![image] + +[image]: http://example.com/image.jpg {height=35mm} +^D +<p><img src="http://example.com/image.jpg" alt="image" style="height:35mm" /></p> +``` diff --git a/test/command/4016.md b/test/command/4016.md new file mode 100644 index 000000000..69ad1c911 --- /dev/null +++ b/test/command/4016.md @@ -0,0 +1,47 @@ +``` +pandoc -t beamer +# Level 2 blocks + +<div class="columns"> +<div class="column" width="40%"> +## Block one +- Item +</div> +<div class="column" width="60%"> +## Block two +- Item +</div> +</div> +^D +\begin{frame}{% +\protect\hypertarget{level-2-blocks}{% +Level 2 blocks}} + +\begin{columns}[T] +\begin{column}{0.40\textwidth} +\begin{block}{Block one} + +\begin{itemize} +\tightlist +\item + Item +\end{itemize} + +\end{block} +\end{column} + +\begin{column}{0.60\textwidth} +\begin{block}{Block two} + +\begin{itemize} +\tightlist +\item + Item +\end{itemize} + +\end{block} +\end{column} +\end{columns} + +\end{frame} +``` diff --git a/test/command/4019.md b/test/command/4019.md new file mode 100644 index 000000000..ab13f0233 --- /dev/null +++ b/test/command/4019.md @@ -0,0 +1,8 @@ +``` +pandoc --wrap=preserve +This <!-- x > 0 --> works! +This <!-- x > 0 --> fails? +^D +<p>This <!-- x > 0 --> works! +This <!-- x > 0 --> fails?</p> +``` diff --git a/test/command/4038.md b/test/command/4038.md new file mode 100644 index 000000000..121760540 --- /dev/null +++ b/test/command/4038.md @@ -0,0 +1,6 @@ +``` +% pandoc -f gfm -t gfm +# ~~Header~~ +^D +# ~~Header~~ +``` diff --git a/test/command/4054.md b/test/command/4054.md new file mode 100644 index 000000000..3689773c4 --- /dev/null +++ b/test/command/4054.md @@ -0,0 +1,14 @@ +``` +% pandoc -t native -s -M title=New +% Old +^D +Pandoc (Meta {unMeta = fromList [("title",MetaString "New")]}) +[] +``` + +``` +% pandoc -t native -s -M foo=1 -M foo=2 +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaList [MetaString "1",MetaString "2"])]}) +[] +``` diff --git a/test/command/4056.md b/test/command/4056.md new file mode 100644 index 000000000..eed4f6d6a --- /dev/null +++ b/test/command/4056.md @@ -0,0 +1,24 @@ +``` +% pandoc -f markdown -t native +\parbox[t]{0.4\textwidth}{ +\begin{shaded} +\end{shaded} +} +^D +[RawBlock (Format "latex") "\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}"] +``` + +``` +% pandoc -f latex -t native +\begin{tabular}{l*{2}{r}} +Blah & Foo & Bar \\ +\end{tabular} +^D +[Table [] [AlignLeft,AlignRight,AlignRight] [0.0,0.0,0.0] + [[] + ,[] + ,[]] + [[[Plain [Str "Blah"]] + ,[Plain [Str "Foo"]] + ,[Plain [Str "Bar"]]]]] +``` diff --git a/test/command/4061.md b/test/command/4061.md new file mode 100644 index 000000000..e850c5e8c --- /dev/null +++ b/test/command/4061.md @@ -0,0 +1,14 @@ +``` +% pandoc -t markdown-simple_tables-multiline_tables-pipe_tables ++-----------------------------------+ +| Text [^1] | ++-----------------------------------+ + +[^1]: Footnote. +^D ++-----------------------------------+ +| Text [^1] | ++-----------------------------------+ + +[^1]: Footnote. +``` diff --git a/test/command/4062.md b/test/command/4062.md new file mode 100644 index 000000000..2e212f826 --- /dev/null +++ b/test/command/4062.md @@ -0,0 +1,6 @@ +``` +% pandoc -t latex +Sentence blah.\footnote[][-.5in]{I'm a footnote} +^D +Sentence blah.\footnote[][-.5in]{I'm a footnote} +``` diff --git a/test/command/4068.md b/test/command/4068.md new file mode 100644 index 000000000..7b43a7084 --- /dev/null +++ b/test/command/4068.md @@ -0,0 +1,9 @@ +``` +pandoc -f mediawiki -t native +[https://domain.com/script.php?a=1&b=2&c=&d=4 open productname bugs] + +[http://domain.com?a=. open productname bugs] +^D +[Para [Link ("",[],[]) [Str "open",Space,Str "productname",Space,Str "bugs"] ("https://domain.com/script.php?a=1&b=2&c=&d=4","")] +,Para [Str "[",Link ("",[],[]) [Str "http://domain.com?a="] ("http://domain.com?a=",""),Str ".",Space,Str "open",Space,Str "productname",Space,Str "bugs]"]] +``` diff --git a/test/command/4091.md b/test/command/4091.md new file mode 100644 index 000000000..13f3323d1 --- /dev/null +++ b/test/command/4091.md @@ -0,0 +1,6 @@ +``` +% pandoc -f latex +\alert<3>{foo} +^D +<p><span class="alert">foo</span></p> +``` diff --git a/test/command/4113.md b/test/command/4113.md new file mode 100644 index 000000000..41fbcaf80 --- /dev/null +++ b/test/command/4113.md @@ -0,0 +1,12 @@ +``` +% pandoc -t gfm +::::{.bug} +I am a [bug]{#bug}. +:::: +^D +<div class="bug"> + +I am a <span id="bug">bug</span>. + +</div> +``` diff --git a/test/command/4119.md b/test/command/4119.md new file mode 100644 index 000000000..70f008643 --- /dev/null +++ b/test/command/4119.md @@ -0,0 +1,18 @@ +``` +pandoc -t native +| col1 | col2 | +| ---- | ---- | +| 1 | 2 | + +::: {.notes} ::: +not a caption! +:::::::::::::::: +^D +[Table [] [AlignDefault,AlignDefault] [0.0,0.0] + [[Plain [Str "col1"]] + ,[Plain [Str "col2"]]] + [[[Plain [Str "1"]] + ,[Plain [Str "2"]]]] +,Div ("",["notes"],[]) + [Para [Str "not",Space,Str "a",Space,Str "caption!"]]] +``` diff --git a/test/command/4125.md b/test/command/4125.md new file mode 100644 index 000000000..8bf09d84c --- /dev/null +++ b/test/command/4125.md @@ -0,0 +1,6 @@ +``` +% pandoc +<?asciidoc-toc?> +^D +<?asciidoc-toc?> +``` diff --git a/test/command/4134.md b/test/command/4134.md new file mode 100644 index 000000000..b5473d948 --- /dev/null +++ b/test/command/4134.md @@ -0,0 +1,25 @@ +``` +% pandoc -f latex -t native +Hello.\ +world. +^D +[Para [Str "Hello.\160world."]] +``` + +``` +% pandoc -f latex -t native +Hello.\ + world. +^D +[Para [Str "Hello.\160world."]] +``` + +``` +% pandoc -f latex -t native +Hello.\ + +World. +^D +[Para [Str "Hello.\160"] +,Para [Str "World."]] +``` diff --git a/test/command/4156.md b/test/command/4156.md new file mode 100644 index 000000000..073537d1f --- /dev/null +++ b/test/command/4156.md @@ -0,0 +1,10 @@ +``` +% pandoc -f rst +.. _`SOMEID`: + +foo +^D +<div id="SOMEID"> +<p>foo</p> +</div> +``` diff --git a/test/command/4159.md b/test/command/4159.md new file mode 100644 index 000000000..4881edcc5 --- /dev/null +++ b/test/command/4159.md @@ -0,0 +1,8 @@ +``` +% pandoc -f markdown -t native +\newcommand{\gen}{a\ Gen\ b} +abc +^D +[RawBlock (Format "latex") "\\newcommand{\\gen}{a\\ Gen\\ b}" +,Para [Str "abc"]] +``` diff --git a/test/command/4162.md b/test/command/4162.md new file mode 100644 index 000000000..d88e1ec4e --- /dev/null +++ b/test/command/4162.md @@ -0,0 +1,10 @@ +``` +% pandoc -f html -t native +<div class="line-block">hi<br /><br> + there</div> +^D +[LineBlock + [[Str "hi"] + ,[] + ,[Str "\160there"]]] +``` diff --git a/test/command/4164.md b/test/command/4164.md new file mode 100644 index 000000000..8cfc960a0 --- /dev/null +++ b/test/command/4164.md @@ -0,0 +1,35 @@ +``` +% pandoc -f opml -t markdown +<?xml version="1.0"?> <opml version="1.0"> <head> <title> test </title> </head> <body> <outline text="test"> <outline text="try" _note="Here is inline html:

<div> 
<balise>
bla bla
</div>"/> </outline> </body> </opml> +^D +test +==== + +try +--- + +Here is inline html: + +<div> + +<balise> bla bla + +</div> + +``` + +``` +% pandoc -f opml-raw_html-native_divs -t markdown +<?xml version="1.0"?> <opml version="1.0"> <head> <title> test </title> </head> <body> <outline text="test"> <outline text="try" _note="Here is inline html:

<div> 
<balise>
bla bla
</div>"/> </outline> </body> </opml> +^D +test +==== + +try +--- + +Here is inline html: + +\<div\> \<balise\> bla bla \</div\> + +``` diff --git a/test/command/4171.md b/test/command/4171.md new file mode 100644 index 000000000..42b4576e3 --- /dev/null +++ b/test/command/4171.md @@ -0,0 +1,34 @@ +``` +% pandoc -f org -t org +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [fn:1] a + +[fn:1] b +^D +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [fn:1] +a + +[fn:1] b +``` + + +``` +% pandoc -f org -t org +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + [fn:1] a + +[fn:1] b +^D +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [fn:1] +a + +[fn:1] b +``` + +Similar bug: "-" should not be wrapped: +``` +% pandoc -f org -t org +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - abc +^D +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - +abc +``` diff --git a/test/command/4172.md b/test/command/4172.md new file mode 100644 index 000000000..6b497a87a --- /dev/null +++ b/test/command/4172.md @@ -0,0 +1,29 @@ +Test that text wrapping does not move note reference [1] to the beginning of the line, +where it would become a note. +``` +% pandoc -f muse -t muse +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [1] a + +[1] b +^D +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [1] +a + +[1] b + +``` + +SoftBreak test: +``` +% pandoc -f muse -t muse +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + [1] a + +[1] b +^D +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [1] +a + +[1] b + +``` diff --git a/test/command/4183.md b/test/command/4183.md new file mode 100644 index 000000000..c18320882 --- /dev/null +++ b/test/command/4183.md @@ -0,0 +1,32 @@ +``` +% pandoc -f html -t native +<figure> + <img src="foo" alt="bar"> +</figure> +^D +[Para [Image ("",[],[]) [] ("foo","fig:")]] +``` + +``` +% pandoc -f html -t native +<figure> + <img src="foo" alt="bar"> + <figcaption> + <div> + baz + </div> + </figcaption> +</figure> +^D +[Para [Image ("",[],[]) [Str "baz"] ("foo","fig:")]] +``` + +``` +% pandoc -f html -t native +<figure> + <img src="foo"> + <figcaption><p><em>baz</em></p></figcaption> +</figure> +^D +[Para [Image ("",[],[]) [Emph [Str "baz"]] ("foo","fig:")]] +``` diff --git a/test/command/4193.md b/test/command/4193.md new file mode 100644 index 000000000..44c7d70cc --- /dev/null +++ b/test/command/4193.md @@ -0,0 +1,10 @@ +``` +% pandoc -f rst -t native +- + a +- b +^D +[BulletList + [[Plain [Str "a"]] + ,[Plain [Str "b"]]]] +``` diff --git a/test/command/4199.md b/test/command/4199.md new file mode 100644 index 000000000..49d2bdbcb --- /dev/null +++ b/test/command/4199.md @@ -0,0 +1,6 @@ +``` +% pandoc -f latex -t native +\foreignlanguage{ngerman}{foo} +^D +[Para [Span ("",[],[("lang","de-DE")]) [Str "foo"]]] +``` diff --git a/test/command/4208.md b/test/command/4208.md new file mode 100644 index 000000000..9bc519d90 --- /dev/null +++ b/test/command/4208.md @@ -0,0 +1,18 @@ +``` +% pandoc -t latex +What is a _piffle_? Mark the correct answer(s): + +\begin{TAB}(@)[6pt]{|l|c|}{|c|c|c|} +(a) a subnormal woffle & $\Box$ \\ +(b) an infinite-dimensional baffle & $\Box$ \\ +(c) an inverted first-order triffle & $\Box$ \\ +\end{TAB} +^D +What is a \emph{piffle}? Mark the correct answer(s): + +\begin{TAB}(@)[6pt]{|l|c|}{|c|c|c|} +(a) a subnormal woffle & $\Box$ \\ +(b) an infinite-dimensional baffle & $\Box$ \\ +(c) an inverted first-order triffle & $\Box$ \\ +\end{TAB} +``` diff --git a/test/command/4235.md b/test/command/4235.md new file mode 100644 index 000000000..a5d545676 --- /dev/null +++ b/test/command/4235.md @@ -0,0 +1,12 @@ +``` +% pandoc --id-prefix=foo +This.^[Has a footnote.] +^D +<p>This.<a href="#foofn1" class="footnote-ref" id="foofnref1"><sup>1</sup></a></p> +<section class="footnotes"> +<hr /> +<ol> +<li id="foofn1"><p>Has a footnote.<a href="#foofnref1" class="footnote-back">↩</a></p></li> +</ol> +</section> +``` diff --git a/test/command/4240.md b/test/command/4240.md new file mode 100644 index 000000000..39a7d2adf --- /dev/null +++ b/test/command/4240.md @@ -0,0 +1,33 @@ +``` +% pandoc -f rst -s -t native +===== +Title +===== + +-------- +Subtitle +-------- + +header1 +======= + +header2 +------- + +.. _id: + +header3 +~~~~~~~ + +.. _id2: +.. _id3: + +header4 +~~~~~~~ +^D +Pandoc (Meta {unMeta = fromList [("subtitle",MetaInlines [Str "Subtitle"]),("title",MetaInlines [Str "Title"])]}) +[Header 1 ("header1",[],[]) [Str "header1"] +,Header 2 ("header2",[],[]) [Str "header2"] +,Header 3 ("id",[],[]) [Str "header3"] +,Header 3 ("id3",[],[]) [Str "header4",Span ("id2",[],[]) []]] +``` diff --git a/test/command/4253.md b/test/command/4253.md new file mode 100644 index 000000000..01f5eea86 --- /dev/null +++ b/test/command/4253.md @@ -0,0 +1,8 @@ +``` +% pandoc -f latex -t native +\newcommand{\noop}[1]{#1} +\noop{\newcommand{\foo}[1]{#1}} +\foo{hi} +^D +[Para [Str "hi"]] +``` diff --git a/test/command/4254.md b/test/command/4254.md new file mode 100644 index 000000000..e4cc5c6b0 --- /dev/null +++ b/test/command/4254.md @@ -0,0 +1,12 @@ +``` +% pandoc -f rst -t latex +.. math:: + + x &= y\\ + y &= z +^D +\[\begin{aligned} +x &= y\\ +y &= z +\end{aligned}\] +``` diff --git a/test/command/4280.md b/test/command/4280.md new file mode 100644 index 000000000..6a89b5e63 --- /dev/null +++ b/test/command/4280.md @@ -0,0 +1,7 @@ +``` +% pandoc -f rst -t native +Driver +------ +^D +[Header 1 ("driver",[],[]) [Str "Driver"]] +``` diff --git a/test/command/4281.md b/test/command/4281.md new file mode 100644 index 000000000..9806e8178 --- /dev/null +++ b/test/command/4281.md @@ -0,0 +1,18 @@ +``` +% pandoc -t native +:::: {.a} +- ::: {.b} + text + ::: + ::: {.c} + text + ::: +:::: +^D +[Div ("",["a"],[]) + [BulletList + [[Div ("",["b"],[]) + [Para [Str "text"]] + ,Div ("",["c"],[]) + [Para [Str "text"]]]]]] +``` diff --git a/test/command/4374.md b/test/command/4374.md new file mode 100644 index 000000000..296c116a9 --- /dev/null +++ b/test/command/4374.md @@ -0,0 +1,7 @@ +``` +% pandoc -f latex -t native +\cite{a% +} +^D +[Para [Cite [Citation {citationId = "a", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cite{a%\n}"]]] +``` diff --git a/test/command/4424.md b/test/command/4424.md new file mode 100644 index 000000000..b0b95510b --- /dev/null +++ b/test/command/4424.md @@ -0,0 +1,10 @@ +``` +% pandoc -f latex -t native +\documentclass{article} +\usepackage[sortlocale=en_GB]{biblatex} +\begin{document} +Test +\end{document} +^D +[Para [Str "Test"]] +``` diff --git a/test/command/512.md b/test/command/512.md new file mode 100644 index 000000000..b95921309 --- /dev/null +++ b/test/command/512.md @@ -0,0 +1,42 @@ +``` +% pandoc -f rst +`click here`__ or `click here`__ + +.. _link1: http://www.example.com/ +.. _link2: http://johnmacfarlane.net/pandoc/ + +__ link1_ +__ link2_ +^D +<p><a href="http://www.example.com/">click here</a> or <a href="http://johnmacfarlane.net/pandoc/">click here</a></p> +``` + +Multiple indirection: + +``` +% pandoc -f rst +`click here`__ + +.. _link1: link2_ +.. _link2: http://johnmacfarlane.net/pandoc/ + +__ link1_ +^D +<p><a href="http://johnmacfarlane.net/pandoc/">click here</a></p> +``` + +Loop detection: + +``` +% pandoc -f rst +`click here`__ + +.. _link1: link2_ +.. _link2: link1_ + +__ link1_ +^D +[WARNING] Circular reference 'link1' at line 1 column 15 +<p><a href="">click here</a></p> +``` + diff --git a/test/command/645.md b/test/command/645.md new file mode 100644 index 000000000..90b285bed --- /dev/null +++ b/test/command/645.md @@ -0,0 +1,12 @@ +Don't use listings commands in \item[..] context: +``` +% pandoc -t latex +`--foo` **BAR** + +: Enables the foo feature with **BAR** as its flavour. +^D +\begin{description} +\item[\texttt{-\/-foo} \textbf{BAR}] +Enables the foo feature with \textbf{BAR} as its flavour. +\end{description} +``` diff --git a/test/command/853.md b/test/command/853.md new file mode 100644 index 000000000..54eb416a9 --- /dev/null +++ b/test/command/853.md @@ -0,0 +1,18 @@ +reStructuredText citations. + +``` +% pandoc -f rst +Here is a citation reference: [CIT2002]_. + +.. [CIT2002] This is the citation. It's just like a footnote, + except the label is textual. +^D +<p>Here is a citation reference: <a href="#CIT2002" class="citation">[CIT2002]</a>.</p> +<div id="citations"> +<dl> +<dt><span id="CIT2002" class="citation-label">CIT2002</span></dt> +<dd><p>This is the citation. It's just like a footnote, except the label is textual.</p> +</dd> +</dl> +</div> +``` diff --git a/test/command/934.md b/test/command/934.md new file mode 100644 index 000000000..ef99abdf9 --- /dev/null +++ b/test/command/934.md @@ -0,0 +1,12 @@ +``` +% pandoc -f latex -t native +\newcommand{\ddb}[2]{ + \textit{``#1''} + + \textbf{#2} +} +\ddb{This should be italic and in quotes}{And this is the attribution} +^D +[Para [Emph [Quoted DoubleQuote [Str "This",Space,Str "should",Space,Str "be",Space,Str "italic",Space,Str "and",Space,Str "in",Space,Str "quotes"]]] +,Para [Strong [Str "And",Space,Str "this",Space,Str "is",Space,Str "the",Space,Str "attribution"]]] +``` diff --git a/test/command/982.md b/test/command/982.md new file mode 100644 index 000000000..5f54f7713 --- /dev/null +++ b/test/command/982.md @@ -0,0 +1,11 @@ +``` +% pandoc -f latex -t native +\newcommand{\BEQ}{\begin{equation}} +\newcommand{\EEQ}{\end{equation}} + +\BEQ +y=x^2 +\EEQ +^D +[Para [Math DisplayMath "y=x^2"]] +``` diff --git a/test/command/987.md b/test/command/987.md new file mode 100644 index 000000000..f632231ef --- /dev/null +++ b/test/command/987.md @@ -0,0 +1,12 @@ +``` +pandoc -f latex -t markdown +\documentclass{article} +\newenvironment{flubble}{FOO}{BAR} +\begin{document} + \begin{flubble} + grr + \end{flubble} +\end{document} +^D +FOO grr BAR +``` diff --git a/test/command/SVG_logo-without-xml-declaration.svg b/test/command/SVG_logo-without-xml-declaration.svg new file mode 100644 index 000000000..febcab6ca --- /dev/null +++ b/test/command/SVG_logo-without-xml-declaration.svg @@ -0,0 +1,32 @@ +<svg viewBox="-50 -50 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<title>SVG Logo</title> +<rect id="background" x="-50" y="-50" width="100" height="100" rx="4" fill="#f90"/> +<rect id="top-left" x="-50" y="-50" width="50" height="50" rx="4" fill="#ffb13b"/> +<rect id="bottom-right" width="50" height="50" rx="4" fill="#de8500"/> +<use stroke="#f90" stroke-width="22.6" xlink:href="#a"/> +<circle r="26"/> +<use stroke="#000" stroke-width="12" xlink:href="#a"/> +<g id="a"> + <g id="b"> + <g id="c"> + <circle id="n" cy="-31.6" r="7.1" fill="#fff"/> + <path d="m0 31.6v-63.2" stroke="#fff" stroke-width="10"/> + <use y="63.2" xlink:href="#n"/> + </g> + <use transform="rotate(90)" xlink:href="#c"/> + </g> + <use transform="rotate(45)" xlink:href="#b"/> +</g> +<path id="text-backdrop" d="m44.68 0v40c0 3.333-1.667 5-5 5h-79.38c-3.333 0-5-1.667-5-5v-40"/> +<path id="shine" d="m36 4.21c2.9 0 5.3 2.4 5.3 5.3v18c-27.6-3.4-54.9-8-82-7.7v-10.2c0-2.93 2.4-5.3 5.3-5.3z" fill="#3f3f3f"/> +<use stroke="#000" stroke-width="7.4" xlink:href="#s"/> +<g id="svg-text" stroke="#fff" stroke-width="6.4"> + <g id="s"> + <path fill="none" d="m-31.74 31.17a8.26 8.26 0 1 0 8.26 -8.26 8.26 8.26 0 1 1 8.26 -8.26M23.23 23h8.288v 8.26a8.26 8.26 0 0 1 -16.52 0v-16.52a8.26 8.26 0 0 1 16.52 0"/> + <g stroke-width=".5" stroke="#000"> + <path d="m4.76 3h6.83l-8.24 39.8h-6.85l-8.26-39.8h6.85l4.84 23.3z" fill="#fff"/> + <path d="m23.23 19.55v6.9m4.838-11.71h6.9m-70.16 16.43h6.9m9.62-16.52h6.9" stroke-linecap="square"/> + </g> + </g> +</g> +</svg> diff --git a/test/command/SVG_logo.svg b/test/command/SVG_logo.svg new file mode 100644 index 000000000..5333a5ddb --- /dev/null +++ b/test/command/SVG_logo.svg @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<svg viewBox="-50 -50 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<title>SVG Logo</title> +<rect id="background" x="-50" y="-50" width="100" height="100" rx="4" fill="#f90"/> +<rect id="top-left" x="-50" y="-50" width="50" height="50" rx="4" fill="#ffb13b"/> +<rect id="bottom-right" width="50" height="50" rx="4" fill="#de8500"/> +<use stroke="#f90" stroke-width="22.6" xlink:href="#a"/> +<circle r="26"/> +<use stroke="#000" stroke-width="12" xlink:href="#a"/> +<g id="a"> + <g id="b"> + <g id="c"> + <circle id="n" cy="-31.6" r="7.1" fill="#fff"/> + <path d="m0 31.6v-63.2" stroke="#fff" stroke-width="10"/> + <use y="63.2" xlink:href="#n"/> + </g> + <use transform="rotate(90)" xlink:href="#c"/> + </g> + <use transform="rotate(45)" xlink:href="#b"/> +</g> +<path id="text-backdrop" d="m44.68 0v40c0 3.333-1.667 5-5 5h-79.38c-3.333 0-5-1.667-5-5v-40"/> +<path id="shine" d="m36 4.21c2.9 0 5.3 2.4 5.3 5.3v18c-27.6-3.4-54.9-8-82-7.7v-10.2c0-2.93 2.4-5.3 5.3-5.3z" fill="#3f3f3f"/> +<use stroke="#000" stroke-width="7.4" xlink:href="#s"/> +<g id="svg-text" stroke="#fff" stroke-width="6.4"> + <g id="s">
+ <path fill="none" d="m-31.74 31.17a8.26 8.26 0 1 0 8.26 -8.26 8.26 8.26 0 1 1 8.26 -8.26M23.23 23h8.288v 8.26a8.26 8.26 0 0 1 -16.52 0v-16.52a8.26 8.26 0 0 1 16.52 0"/>
+ <g stroke-width=".5" stroke="#000"> + <path d="m4.76 3h6.83l-8.24 39.8h-6.85l-8.26-39.8h6.85l4.84 23.3z" fill="#fff"/>
+ <path d="m23.23 19.55v6.9m4.838-11.71h6.9m-70.16 16.43h6.9m9.62-16.52h6.9" stroke-linecap="square"/>
+ </g> + </g> +</g> +</svg> diff --git a/test/command/abbrevs b/test/command/abbrevs new file mode 100644 index 000000000..1f8efe68e --- /dev/null +++ b/test/command/abbrevs @@ -0,0 +1,2 @@ +Foo. +h.k. diff --git a/test/command/adjacent_latex_blocks.md b/test/command/adjacent_latex_blocks.md new file mode 100644 index 000000000..3e72f1d4f --- /dev/null +++ b/test/command/adjacent_latex_blocks.md @@ -0,0 +1,9 @@ +``` +% pandoc -f markdown -t native +\listoffigures + +\listoftables +^D +[RawBlock (Format "latex") "\\listoffigures" +,RawBlock (Format "latex") "\\listoftables"] +``` diff --git a/test/command/cite-in-inline-note.md b/test/command/cite-in-inline-note.md new file mode 100644 index 000000000..069484eed --- /dev/null +++ b/test/command/cite-in-inline-note.md @@ -0,0 +1,6 @@ +``` +% pandoc -t native +foo^[bar [@doe]] +^D +[Para [Str "foo",Note [Para [Str "bar",Space,Cite [Citation {citationId = "doe", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@doe]"]]]]] +``` diff --git a/test/command/corrupt.svg b/test/command/corrupt.svg new file mode 100644 index 000000000..cfaa697f0 --- /dev/null +++ b/test/command/corrupt.svg @@ -0,0 +1,5 @@ +Lorem ipsum dolor sit amet etiam. A pede dolor neque pretium luctus pharetra vel rutrum. Orci nonummy ac. At eu est tempor +proin wisi. Nunc tincidunt proin. Suspendisse lorem commodo. Integer diam diam semper commodo dictum et tellus eu ultrices +nec erat pulvinar porttitor nulla nulla mauris orci libero eros elementum et possimus voluptate. Velit morbi et. Luctus diam +in. Lorem tincidunt sem dolor rerum mauris. Dis taciti posuere pellentesque sed rutrum. Lectus donec fusce in dictum pede. +In etiam congue. Aliquam aliquet elit arcu mauris enim. Risus at enim. diff --git a/test/command/dots.md b/test/command/dots.md new file mode 100644 index 000000000..08bc561a8 --- /dev/null +++ b/test/command/dots.md @@ -0,0 +1,12 @@ +``` +% pandoc -f latex -t native +\dots + +\ldots + +\vdots +^D +[Para [Str "\8230"] +,Para [Str "\8230"] +,Para [Str "\8942"]] +``` diff --git a/test/command/empty_paragraphs.md b/test/command/empty_paragraphs.md new file mode 100644 index 000000000..001aaf1b0 --- /dev/null +++ b/test/command/empty_paragraphs.md @@ -0,0 +1,95 @@ +``` +% pandoc -f native -t docx -o - | pandoc -f docx -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t docx -o - | pandoc -f docx+empty_paragraphs -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx+empty_paragraphs -t native +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +[Para [Str "hi"] +,Para [] +,Para [] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t html5 +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<p>hi</p> + + +<p>lo</p> +``` + +``` +% pandoc -f native -t html5+empty_paragraphs +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<p>hi</p> +<p></p> +<p></p> +<p>lo</p> +``` + +``` +% pandoc -f html+empty_paragraphs -t native +<p>hi</p> +<p></p> +<p></p> +<p>lo</p> +^D +[Para [Str "hi"] +,Para [] +,Para [] +,Para [Str "lo"]] +``` + +``` +% pandoc -f html -t native +<p>hi</p> +<p></p> +<p></p> +<p>lo</p> +^D +[Para [Str "hi"] +,Para [Str "lo"]] +``` + +``` +% pandoc -f native -t opendocument+empty_paragraphs +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<text:p text:style-name="Text_20_body">hi</text:p> +<text:p text:style-name="Text_20_body"></text:p> +<text:p text:style-name="Text_20_body"></text:p> +<text:p text:style-name="Text_20_body">lo</text:p> +``` + +``` +% pandoc -f native -t opendocument +[Para [Str "hi"], Para [], Para [], Para [Str "lo"]] +^D +<text:p text:style-name="Text_20_body">hi</text:p> +<text:p text:style-name="Text_20_body">lo</text:p> +``` diff --git a/test/command/gfm.md b/test/command/gfm.md new file mode 100644 index 000000000..670f3cd6e --- /dev/null +++ b/test/command/gfm.md @@ -0,0 +1,103 @@ +gfm tests: + +``` +% pandoc -f gfm -t native +| Fruit | Price | +| ----- | ----: | +| apple | 0.13 | +| orange|1.12| +^D +[Table [] [AlignDefault,AlignRight] [0.0,0.0] + [[Plain [Str "Fruit"]] + ,[Plain [Str "Price"]]] + [[[Plain [Str "apple"]] + ,[Plain [Str "0.13"]]] + ,[[Plain [Str "orange"]] + ,[Plain [Str "1.12"]]]]] +``` + +``` +% pandoc -f gfm -t native +~~stricken out~~ +^D +[Para [Strikeout [Str "stricken",Space,Str "out"]]] +``` + +``` +% pandoc -f gfm -t native +# Header +## Header +# -foo-bar_baz +^D +[Header 1 ("header",[],[]) [Str "Header"] +,Header 2 ("header-1",[],[]) [Str "Header"] +,Header 1 ("-foo-bar_baz",[],[]) [Str "-foo-bar_baz"]] +``` + +``` +% pandoc -f gfm -t native +My:thumbsup:emoji:heart: +^D +[Para [Str "My\128077emoji\10084\65039"]] +``` + +``` +% pandoc -f gfm -t native +"hi" +^D +[Para [Str "\"hi\""]] +``` + +``` +% pandoc -f gfm+smart -t native +"hi" +^D +[Para [Str "\8220hi\8221"]] +``` + +``` +% pandoc -t gfm -f native +[Table [Str "The",Space,Str "caption."] [AlignDefault,AlignRight] [0.0,0.0] + [[Plain [Str "Fruit"]] + ,[Plain [Str "Price"]]] + [[[Plain [Str "apple"]] + ,[Plain [Str "0.13"]]] + ,[[Plain [Str "orange"]] + ,[Plain [Str "1.12"]]]]] +^D +| Fruit | Price | +| ------ | ----: | +| apple | 0.13 | +| orange | 1.12 | + +The caption. +``` + +``` +% pandoc -f gfm-smart -t gfm+smart +“hi” +^D +"hi" +``` + +``` +% pandoc -f gfm+smart -t gfm-smart +"hi" +^D +“hi” +``` + +``` +% pandoc -f gfm+smart -t gfm+smart +"hi" +^D +"hi" +``` + +``` +% pandoc -f gfm+hard_line_breaks -t native +hi +hi +^D +[Para [Str "hi",LineBreak,Str "hi"]] +``` diff --git a/test/command/hspace.md b/test/command/hspace.md new file mode 100644 index 000000000..ec1669ca5 --- /dev/null +++ b/test/command/hspace.md @@ -0,0 +1,56 @@ +`\hspace` and `\vspace` should count as both block and inline. + +Here they need to be inline: +``` +% pandoc -f markdown+raw_tex -t native +\begin{figure} +\includegraphics{lalune.jpg} +\caption{lalune \hspace{2em} \vspace{1em} bloo} +\end{figure} +^D +[RawBlock (Format "latex") "\\begin{figure}\n\\includegraphics{lalune.jpg}\n\\caption{lalune \\hspace{2em} \\vspace{1em} bloo}\n\\end{figure}"] +``` + +Here block: +``` +% pandoc -f markdown+raw_tex -t native +\begin{tabular}[t]{cc|c} +\(P\) & \(Q\) & \(P\wedge Q\)\\ +\hline +T & T &\\ +T & F &\\ +F & T &\\ +F & F &\\ +\end{tabular} +\hspace{1em} +\begin{tabular}[t]{cc|c} +\(P\) & \(Q\) & \(P\vee Q\)\\ +\hline +T & T &\\ +T & F &\\ +F & T &\\ +F & F &\\ +\end{tabular} +^D +[RawBlock (Format "latex") "\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\wedge Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}\n\\hspace{1em}\n\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\vee Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}"] +``` + +``` +% pandoc -f markdown+raw_tex -t native +hi\hspace{1em}there +^D +[Para [Str "hi",RawInline (Format "tex") "\\hspace{1em}",Str "there"]] +``` + +``` +% pandoc -f markdown+raw_tex -t native +hi + +\hspace{1em} + +there +^D +[Para [Str "hi"] +,RawBlock (Format "latex") "\\hspace{1em}" +,Para [Str "there"]] +``` diff --git a/test/command/html-read-figure.md b/test/command/html-read-figure.md new file mode 100644 index 000000000..9c604c706 --- /dev/null +++ b/test/command/html-read-figure.md @@ -0,0 +1,45 @@ +``` +% pandoc -f html -t native +<figure> + <img src="foo.png" title="voyage"> + <figcaption>bar</figcaption> +</figure> +^D +[Para [Image ("",[],[]) [Str "bar"] ("foo.png","fig:voyage")]] +``` + +``` +% pandoc -f html -t native +<figure> + <figcaption>bar</figcaption> + <img src="foo.png" title="voyage"> +</figure> +^D +[Para [Image ("",[],[]) [Str "bar"] ("foo.png","fig:voyage")]] +``` + +``` +% pandoc -f html -t native +<figure> + <img src="foo.png" title="voyage"> +</figure> +^D +[Para [Image ("",[],[]) [] ("foo.png","fig:voyage")]] +``` + +``` +% pandoc -f html -t native +<figure> + <p><img src="foo.png" title="voyage"></p> + <figcaption>bar</figcaption> +</figure> +^D +[Para [Image ("",[],[]) [Str "bar"] ("foo.png","fig:voyage")]] +``` + +``` +% pandoc -f html -t native +<figure><img src="foo.png" title="voyage" alt="this is ignored"><figcaption>bar <strong>baz</strong></figcaption></figure> +^D +[Para [Image ("",[],[]) [Str "bar",Space,Strong [Str "baz"]] ("foo.png","fig:voyage")]] +``` diff --git a/test/command/hyphenat.md b/test/command/hyphenat.md new file mode 100644 index 000000000..3aae85101 --- /dev/null +++ b/test/command/hyphenat.md @@ -0,0 +1,49 @@ +``` +% pandoc -f latex -t native +electromagnetic\hyp{}endioscopy +^D +[Para [Str "electromagnetic-endioscopy"]] +``` + +``` +% pandoc -f latex -t native +C\colonhyp\bshyp{}Windows\bshyp +^D +[Para [Str "C:\173\\\173Windows\\\173"]] +``` + +``` +% pandoc -f latex -t native +\fshyp{}usr\fshyp{}share\fshyp +^D +[Para [Str "/\173usr/\173share/\173"]] +``` + +``` +% pandoc -f latex -t native +\fshyp{}home\fshyp{}schrieveslaach\fshyp\dothyp{}m2 +^D +[Para [Str "/\173home/\173schrieveslaach/\173.\173m2"]] +``` + +``` +% pandoc -f latex -t native +\nohyphens{Pneumonoultramicroscopicsilicovolcanoconiosis} +^D +[Para [Str "Pneumonoultramicroscopicsilicovolcanoconiosis"]] +``` + +``` +% pandoc -f latex -t native +\textnhtt{Pneumonoultramicroscopicsilicovolcanoconiosis} +^D +[Para [Code ("",[],[]) "Pneumonoultramicroscopicsilicovolcanoconiosis"]] +``` + +``` +% pandoc -f latex -t native +\nhttfamily{Pneumonoultramicroscopicsilicovolcanoconiosis} +^D +[Para [Code ("",[],[]) "Pneumonoultramicroscopicsilicovolcanoconiosis"]] +``` + diff --git a/test/command/ifstrequal.md b/test/command/ifstrequal.md new file mode 100644 index 000000000..4ad04d2e1 --- /dev/null +++ b/test/command/ifstrequal.md @@ -0,0 +1,10 @@ +``` +% pandoc -f latex -t native +\ifstrequal{a}{b}{yes}{\emph{no}} +\newcommand{\h}[1]{\ifstrequal{#1}{a}{\'a}{#1}} +\h{a} +\h{b} +^D +[Para [Emph [Str "no"]] +,Para [Str "\225",SoftBreak,Str "b"]] +``` diff --git a/test/command/indented-fences.md b/test/command/indented-fences.md new file mode 100644 index 000000000..eb3b78212 --- /dev/null +++ b/test/command/indented-fences.md @@ -0,0 +1,20 @@ +````` +% pandoc -t native + ```haskell + let x = y +in y + ``` +^D +[CodeBlock ("",["haskell"],[]) "let x = y\nin y"] +````` +````` +% pandoc -t native + ~~~ {.haskell} + let x = y + in y + +y + + y +~~~ +^D +[CodeBlock ("",["haskell"],[]) " let x = y\nin y +\ny +\ny"] +````` diff --git a/test/command/inkscape-cube.svg b/test/command/inkscape-cube.svg new file mode 100644 index 000000000..995c3c734 --- /dev/null +++ b/test/command/inkscape-cube.svg @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="38.772217mm" + height="46.163891mm" + viewBox="0 0 38.772217 46.163891" + version="1.1" + id="svg8" + inkscape:version="0.92.1 r" + sodipodi:docname="cube.svg"> + <defs + id="defs2"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="-48.380952 : -45.023815 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="161.61905 : -45.023817 : 1" + inkscape:persp3d-origin="56.619048 : -94.523816 : 1" + id="perspective4485" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="-63.181251" + inkscape:cy="-116.38602" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1920" + inkscape:window-height="1136" + inkscape:window-x="1920" + inkscape:window-y="30" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Ebene 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-149.67857,78.746839)"> + <g + sodipodi:type="inkscape:box3d" + id="g4487" + style="opacity:0.2;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.53100002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + inkscape:perspectiveID="#perspective4485" + inkscape:corner0="1.1045097 : 0.18860662 : 0 : 1" + inkscape:corner7="0.52634769 : 0.15538942 : 0.25 : 1"> + <path + sodipodi:type="inkscape:box3dside" + id="path4489" + style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + inkscape:box3dsidetype="6" + d="m 151.19047,-53.658435 v 15.783818 l 17.00006,5.342459 v -14.107905 z" + points="151.19047,-37.874617 168.19053,-32.532158 168.19053,-46.640063 151.19047,-53.658435 " /> + <path + sodipodi:type="inkscape:box3dside" + id="path4499" + style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + inkscape:box3dsidetype="11" + d="m 168.19053,-46.640063 21.77216,-19.229539 v 18.699717 l -21.77216,14.637727 z" + points="189.96269,-65.869602 189.96269,-47.169885 168.19053,-32.532158 168.19053,-46.640063 " /> + <path + sodipodi:type="inkscape:box3dside" + id="path4491" + style="fill:#4d4d9f;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + inkscape:box3dsidetype="5" + d="m 151.19047,-53.658435 18.89881,-25.037614 19.87341,12.826447 -21.77216,19.229539 z" + points="170.08928,-78.696049 189.96269,-65.869602 168.19053,-46.640063 151.19047,-53.658435 " /> + <path + sodipodi:type="inkscape:box3dside" + id="path4497" + style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + inkscape:box3dsidetype="13" + d="m 151.19047,-37.874617 18.89881,-19.058894 19.87341,9.763626 -21.77216,14.637727 z" + points="170.08928,-56.933511 189.96269,-47.169885 168.19053,-32.532158 151.19047,-37.874617 " /> + <path + sodipodi:type="inkscape:box3dside" + id="path4495" + style="fill:#d7d7ff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + inkscape:box3dsidetype="14" + d="m 170.08928,-78.696049 v 21.762538 l 19.87341,9.763626 v -18.699717 z" + points="170.08928,-56.933511 189.96269,-47.169885 189.96269,-65.869602 170.08928,-78.696049 " /> + <path + sodipodi:type="inkscape:box3dside" + id="path4493" + style="fill:#8686bf;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + inkscape:box3dsidetype="3" + d="m 151.19047,-53.658435 18.89881,-25.037614 v 21.762538 l -18.89881,19.058894 z" + points="170.08928,-78.696049 170.08928,-56.933511 151.19047,-37.874617 151.19047,-53.658435 " /> + </g> + </g> +</svg> diff --git a/test/command/latex-color.md b/test/command/latex-color.md new file mode 100644 index 000000000..9fd2585a3 --- /dev/null +++ b/test/command/latex-color.md @@ -0,0 +1,127 @@ +# `\textcolor{}{}` + +``` +% pandoc -f latex -t native +Hello \textcolor{red}{World} +^D +[Para [Str "Hello",Space,Span ("",[],[("style","color: red")]) [Str "World"]]] +``` + +``` +% pandoc -f latex -t native +\textcolor{red}{Hello} World +^D +[Para [Span ("",[],[("style","color: red")]) [Str "Hello"],Space,Str "World"]] +``` + +``` +% pandoc -f latex -t native +Hello \textcolor{blue}{\textbf{World}} +^D +[Para [Str "Hello",Space,Span ("",[],[("style","color: blue")]) [Strong [Str "World"]]]] +``` + + +``` +% pandoc -f latex -t native +Hello \textcolor{blue}{\textbf{World}}. +^D +[Para [Str "Hello",Space,Span ("",[],[("style","color: blue")]) [Strong [Str "World"]],Str "."]] +``` + +``` +% pandoc -f latex -t native +\textcolor{orange}{ +\begin{itemize} + \item Item 1 + \item Item 2 +\end{itemize} +} +^D +[Div ("",[],[("style","color: orange")]) + [BulletList + [[Para [Str "Item",Space,Str "1"]] + ,[Para [Str "Item",Space,Str "2"]]]]] +``` + +``` +% pandoc -f latex -t native +\textcolor{blue}{ +\begin{itemize} + \item Item 1 + \item Item 2 +\end{itemize} +} some more text +^D +[Div ("",[],[("style","color: blue")]) + [BulletList + [[Para [Str "Item",Space,Str "1"]] + ,[Para [Str "Item",Space,Str "2"]]]] +,Para [Str "some",Space,Str "more",Space,Str "text"]] +``` + +# `\colorbox{}{}` + + +``` +% pandoc -f latex -t native +Hello \colorbox{red}{World} +^D +[Para [Str "Hello",Space,Span ("",[],[("style","background-color: red")]) [Str "World"]]] +``` + +``` +% pandoc -f latex -t native +\colorbox{red}{Hello} World +^D +[Para [Span ("",[],[("style","background-color: red")]) [Str "Hello"],Space,Str "World"]] +``` + +``` +% pandoc -f latex -t native +Hello \colorbox{blue}{\textbf{World}} +^D +[Para [Str "Hello",Space,Span ("",[],[("style","background-color: blue")]) [Strong [Str "World"]]]] +``` + +``` +% pandoc -f latex -t native +Hello \colorbox{blue}{\textbf{World}}. +^D +[Para [Str "Hello",Space,Span ("",[],[("style","background-color: blue")]) [Strong [Str "World"]],Str "."]] +``` + +``` +% pandoc -f latex -t native +\colorbox{orange}{ +\begin{minipage}{\textwidth} +\begin{itemize} + \item Item 1 + \item Item 2 +\end{itemize} +\end{minipage} +} +^D +[Div ("",[],[("style","background-color: orange")]) + [BulletList + [[Para [Str "Item",Space,Str "1"]] + ,[Para [Str "Item",Space,Str "2"]]]]] +``` + +``` +% pandoc -f latex -t native +\colorbox{blue}{ +\begin{minipage}{\textwidth} +\begin{itemize} + \item Item 1 + \item Item 2 +\end{itemize} +\end{minipage} +} some more text +^D +[Div ("",[],[("style","background-color: blue")]) + [BulletList + [[Para [Str "Item",Space,Str "1"]] + ,[Para [Str "Item",Space,Str "2"]]]] +,Para [Str "some",Space,Str "more",Space,Str "text"]] +``` diff --git a/test/command/latex-command-comment.md b/test/command/latex-command-comment.md new file mode 100644 index 000000000..640277f15 --- /dev/null +++ b/test/command/latex-command-comment.md @@ -0,0 +1,7 @@ +``` +pandoc -f latex -t native +\emph% +{hi} +^D +[Para [Emph [Str "hi"]]] +``` diff --git a/test/command/latex-fontawesome.md b/test/command/latex-fontawesome.md new file mode 100644 index 000000000..2a7e91185 --- /dev/null +++ b/test/command/latex-fontawesome.md @@ -0,0 +1,13 @@ +``` +% pandoc -f latex -t native +Check: \faCheck +^D +[Para [Str "Check:",Space,Str "\10003"]] +``` + +``` +% pandoc -f latex -t native +Close: \faClose +^D +[Para [Str "Close:",Space,Str "\10007"]] +``` diff --git a/test/command/latex-tabular-column-specs.md b/test/command/latex-tabular-column-specs.md new file mode 100644 index 000000000..ed44a9980 --- /dev/null +++ b/test/command/latex-tabular-column-specs.md @@ -0,0 +1,24 @@ +See https://groups.google.com/forum/#!topic/pandoc-discuss/_VXtqihCyDU. + +``` +% pandoc -f latex -t native +\begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}} +\toprule +& f1 & f2 \\ +\midrule +e & 0.5 & 4 \\ +f & 0.5 & 5,5 \\ +\bottomrule +\end{tabular} +^D +[Table [] [AlignLeft,AlignLeft,AlignLeft] [0.0,0.0,0.0] + [[Plain [Math InlineMath ""]] + ,[Plain [Math InlineMath "f1"]] + ,[Plain [Math InlineMath "f2"]]] + [[[Plain [Math InlineMath "e"]] + ,[Plain [Math InlineMath "0.5"]] + ,[Plain [Math InlineMath "4"]]] + ,[[Plain [Math InlineMath "f"]] + ,[Plain [Math InlineMath "0.5"]] + ,[Plain [Math InlineMath "5,5"]]]]] +``` diff --git a/test/command/lettrine.md b/test/command/lettrine.md new file mode 100644 index 000000000..0c3c64d66 --- /dev/null +++ b/test/command/lettrine.md @@ -0,0 +1,9 @@ +``` +% pandoc -f latex -t native +\lettrine{A}{category} is + +\lettrine[lhang=0.17]{A}{category} is +^D +[Para [Span ("",["lettrine"],[]) [Str "A"],Span ("",[],[]) [Str "category"],Space,Str "is"] +,Para [Span ("",["lettrine"],[]) [Str "A"],Span ("",[],[]) [Str "category"],Space,Str "is"]] +``` diff --git a/test/command/lstlisting.md b/test/command/lstlisting.md new file mode 100644 index 000000000..d928cc702 --- /dev/null +++ b/test/command/lstlisting.md @@ -0,0 +1,25 @@ +``` +% pandoc -f latex -t native +\begin{lstlisting}[language=Java, caption={Java Example}, label=lst:Hello-World] +public class World { + public static void main(String[] args) { + System.out.println("Hello World"); + } +} +\end{lstlisting} +^D +[CodeBlock ("lst:Hello-World",["java"],[("language","Java"),("caption","Java Example"),("label","lst:Hello-World")]) "public class World {\n public static void main(String[] args) {\n System.out.println(\"Hello World\");\n }\n}"] +``` + +``` +% pandoc -f latex -t native +\begin{lstlisting}[language=Java, escapechar=|, caption={Java Example}, label=lst:Hello-World] +public class World { + public static void main(String[] args) { + System.out.println("Hello World"); + } +} +\end{lstlisting} +^D +[CodeBlock ("lst:Hello-World",["java"],[("language","Java"),("escapechar","|"),("caption","Java Example"),("label","lst:Hello-World")]) "public class World {\n public static void main(String[] args) {\n System.out.println(\"Hello World\");\n }\n}"] +``` diff --git a/test/command/macros.md b/test/command/macros.md new file mode 100644 index 000000000..9de87e7a0 --- /dev/null +++ b/test/command/macros.md @@ -0,0 +1,103 @@ +``` +% pandoc -f markdown+latex_macros -t markdown +\newcommand{\my}{\phi} +$\my+\my$ +^D +\newcommand{\my}{\phi} +$\phi+\phi$ +``` + +``` +% pandoc -f markdown-latex_macros -t markdown +\newcommand{\my}{\phi} +$\my+\my$ +^D +\newcommand{\my}{\phi} +$\my+\my$ +``` + +`\let` macros should be expanded at point of +definition, while `\newcommand` macros should be +expanded at point of use: + +``` +% pandoc -f latex -t latex +\let\a\b +\newcommand{\b}{\emph{ouk}} +\a +^D +\b +``` + +``` +% pandoc -f latex -t latex +\newcommand{\a}{\b} +\newcommand{\b}{\emph{ouk}} +\a +^D +\emph{ouk} +``` + +``` +% pandoc -f latex -t latex +\def\BDpos{} +\def\BDneg{-} +\def\beq{\begin{align}} +\def\eeq{\end{align}} +\def\e#1{\emph{#1}} +\def\f#1#2{\emph{#1--#2}} + +$5\BDneg 6\BDpos 7$ + +\beq +x &= y\\ +\eeq + +\e{hi} + +\f{hi}{ok} +^D +\(5-67\) + +\[\begin{aligned} +x &= y\\\end{aligned}\] + +\emph{hi} + +\emph{hi--ok} +``` + +``` +% pandoc -f markdown+latex_macros -t markdown +\newcommand{\my}{\phi} +\begin{equation} +\my+\my +\end{equation} +^D +\newcommand{\my}{\phi} +\begin{equation} +\phi+\phi +\end{equation} +``` + +``` +% pandoc -f markdown-latex_macros -t markdown +\newcommand{\my}{\phi} +\begin{equation} +\my+\my +\end{equation} +^D +\newcommand{\my}{\phi} +\begin{equation} +\my+\my +\end{equation} +``` + +``` +% pandoc -f markdown+latex_macros -t markdown +\newcommand{\my}{\emph{a}} +\my +^D +\newcommand{\my}{\emph{a}} +\emph{a} +``` diff --git a/test/command/md-abbrevs.md b/test/command/md-abbrevs.md new file mode 100644 index 000000000..15f4d6a9a --- /dev/null +++ b/test/command/md-abbrevs.md @@ -0,0 +1,31 @@ +Pandoc recognizes an abbreviation and inserts a nonbreaking +space (among other things, this prevents a sentence-ending +space from being inserted in LaTeX output). + +``` +% pandoc -t native +Mr. Bob +^D +[Para [Str "Mr.\160Bob"]] +``` + +Here pandoc readjusts the softbreak so that the nonbreaking +space can be inserted: + +``` +% pandoc -t native +Hi Mr. +Bob +^D +[Para [Str "Hi",SoftBreak,Str "Mr.\160Bob"]] +``` + +If you don't want this to happen you can escape the period: + +``` +% pandoc -t native +Hi Mr\. Bob +^D +[Para [Str "Hi",Space,Str "Mr.",Space,Str "Bob"]] +``` + diff --git a/test/command/multiple-metadata-blocks.md b/test/command/multiple-metadata-blocks.md new file mode 100644 index 000000000..27c5e3dae --- /dev/null +++ b/test/command/multiple-metadata-blocks.md @@ -0,0 +1,15 @@ +If multiple blocks define a field, the first is used. + +``` +% pandoc -s -t native +--- +foo: bar +... + +--- +foo: bim +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaInlines [Str "bar"])]}) +[] +``` diff --git a/test/command/parse-raw.md b/test/command/parse-raw.md new file mode 100644 index 000000000..f4e493c69 --- /dev/null +++ b/test/command/parse-raw.md @@ -0,0 +1,27 @@ +``` +% pandoc -f latex+raw_tex -t markdown +\emph{Hi \foo{there}} +^D +*Hi \foo{there}* +``` + +``` +% pandoc -f latex -t markdown +\emph{Hi \foo{there}} +^D +*Hi* +``` + +``` +% pandoc -f html+raw_html -t markdown +<em>Hi <blink>there</blink></em> +^D +*Hi <blink>there</blink>* +``` + +``` +% pandoc -f html -t markdown +<em>Hi <blink>there</blink></em> +^D +*Hi there* +``` diff --git a/test/command/refs.md b/test/command/refs.md new file mode 100644 index 000000000..66959e5c3 --- /dev/null +++ b/test/command/refs.md @@ -0,0 +1,54 @@ +``` +% pandoc -f latex -t native +Figure \ref{fig:1} +^D +[Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:1")]) [Str "[fig:1]"] ("#fig:1","")]] +``` + +``` +% pandoc -f latex -t native +Figure \cref{fig:1} +^D +[Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:1")]) [Str "[fig:1]"] ("#fig:1","")]] +``` + +``` +% pandoc -f latex -t native +Figure \vref{fig:1} +^D +[Para [Str "Figure",Space,Link ("",[],[("reference-type","ref+page"),("reference","fig:1")]) [Str "[fig:1]"] ("#fig:1","")]] +``` + +``` +% pandoc -f latex -t native +Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all results. + +\begin{equation} + \label{eq:Accuracy} + Accuracy = \frac{t_p + t_n}{t_p + f_p + f_n + t_n} +\end{equation} +^D +[Para [Str "Accuracy\160",Link ("",[],[("reference-type","eqref"),("reference","eq:Accuracy")]) [Str "[eq:Accuracy]"] ("#eq:Accuracy",""),Space,Str "is",Space,Str "the",Space,Str "proportion,",Space,Str "measuring",Space,Str "true",Space,Str "results",Space,Str "among",Space,Str "all",Space,Str "results."] +,Para [Math DisplayMath "\\label{eq:Accuracy}\n Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}"]] +``` + +``` +% pandoc -f latex -t native +\begin{figure} + \includegraphics{command/SVG_logo.svg} + \caption{Logo} + \label{fig:Logo} +\end{figure} + +Figure \ref{fig:Logo} illustrated the SVG logo +^D +[Para [Image ("",[],[]) [Str "Logo",Span ("",[],[("label","fig:Logo")]) []] ("command/SVG_logo.svg","fig:")] +,Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:Logo")]) [Str "[fig:Logo]"] ("#fig:Logo",""),Space,Str "illustrated",Space,Str "the",Space,Str "SVG",Space,Str "logo"]] +``` + +``` +% pandoc -f latex -t native +\label{section} Section \ref{section} +^D +[Para [Span ("section",[],[("label","section")]) [Str "[section]"],Space,Str "Section",Space,Link ("",[],[("reference-type","ref"),("reference","section")]) [Str "[section]"] ("#section","")]] +``` diff --git a/test/command/rst-links.md b/test/command/rst-links.md new file mode 100644 index 000000000..496bebc54 --- /dev/null +++ b/test/command/rst-links.md @@ -0,0 +1,18 @@ +``` +% pandoc -f rst +`*ab*`_ + +.. _`*ab*`: foo +^D +<p><a href="foo">*ab*</a></p> +``` + +``` +% pandoc -f rst +`A B +c`_ + +.. _A B C: foo +^D +<p><a href="foo">A B c</a></p> +``` diff --git a/test/command/smart.md b/test/command/smart.md new file mode 100644 index 000000000..e64d67de2 --- /dev/null +++ b/test/command/smart.md @@ -0,0 +1,45 @@ +``` +% pandoc -f markdown+smart -t markdown-smart +"hi"...dog's breath---cat 5--6 +^D +“hi”…dog’s breath—cat 5–6 +``` + +``` +% pandoc -f markdown+smart -t markdown+smart +"hi"...dog's breath---cat 5--6 +^D +"hi"...dog's breath---cat 5--6 +``` + +When we render literal quotes without smart, we need to escape: + +``` +% pandoc -f markdown-smart \ + -t markdown+smart +"hi"...dog's breath---cat 5--6 +^D +\"hi\"\...dog\'s breath\-\--cat 5\--6 +``` + +``` +% pandoc -f markdown+smart -t rst-smart +"hi"...dog's breath---cat 5--6 +^D +“hi”…dog’s breath—cat 5–6 +``` + +``` +% pandoc -f markdown+smart -t rst+smart +"hi"...dog's breath---cat 5--6 +^D +"hi"...dog's breath---cat 5--6 +``` + +``` +% pandoc -f markdown-smart -t rst+smart +"hi"...dog's breath---cat 5--6 +^D +\"hi\"\...dog\'s breath\-\--cat 5\--6 +``` + diff --git a/test/command/sub-file-chapter-1.tex b/test/command/sub-file-chapter-1.tex new file mode 100644 index 000000000..9b3f38f58 --- /dev/null +++ b/test/command/sub-file-chapter-1.tex @@ -0,0 +1,8 @@ +\documentclass[main.tex]{subfiles} +\begin{document} + +\section{Chapter 1} + +This is Chapter 1, provided in a sub file. + +\end{document} diff --git a/test/command/sub-file-chapter-2.tex b/test/command/sub-file-chapter-2.tex new file mode 100644 index 000000000..88e8a0ecc --- /dev/null +++ b/test/command/sub-file-chapter-2.tex @@ -0,0 +1,8 @@ +\documentclass[main.tex]{subfiles} +\begin{document} + +\section{Chapter 2} + +This is Chapter 2, provided in a second sub file. + +\end{document} diff --git a/test/command/svg.md b/test/command/svg.md new file mode 100644 index 000000000..26a8213f6 --- /dev/null +++ b/test/command/svg.md @@ -0,0 +1,132 @@ +``` +% pandoc -f latex -t icml +\includegraphics{command/corrupt.svg} +^D +[WARNING] Could not determine image size for 'command/corrupt.svg': could not determine image type +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100"> + <Properties> + <PathGeometry> + <GeometryPathType PathOpen="false"> + <PathPointArray> + <PathPointType Anchor="-150 -100" LeftDirection="-150 -100" RightDirection="-150 -100" /> + <PathPointType Anchor="-150 100" LeftDirection="-150 100" RightDirection="-150 100" /> + <PathPointType Anchor="150 100" LeftDirection="150 100" RightDirection="150 100" /> + <PathPointType Anchor="150 -100" LeftDirection="150 -100" RightDirection="150 -100" /> + </PathPointArray> + </GeometryPathType> + </PathGeometry> + </Properties> + <Image Self="ue6" ItemTransform="1 0 0 1 -150 -100"> + <Properties> + <Profile type="string"> + $ID/Embedded + </Profile> + </Properties> + <Link Self="ueb" LinkResourceURI="file:command/corrupt.svg" /> + </Image> + </Rectangle> + </CharacterStyleRange> +</ParagraphStyleRange> +``` + +``` +% pandoc -f latex -t icml +\includegraphics{command/SVG_logo.svg} +^D +[WARNING] Could not determine image size for 'command/SVG_logo.svg': could not determine SVG size +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100"> + <Properties> + <PathGeometry> + <GeometryPathType PathOpen="false"> + <PathPointArray> + <PathPointType Anchor="-150 -100" LeftDirection="-150 -100" RightDirection="-150 -100" /> + <PathPointType Anchor="-150 100" LeftDirection="-150 100" RightDirection="-150 100" /> + <PathPointType Anchor="150 100" LeftDirection="150 100" RightDirection="150 100" /> + <PathPointType Anchor="150 -100" LeftDirection="150 -100" RightDirection="150 -100" /> + </PathPointArray> + </GeometryPathType> + </PathGeometry> + </Properties> + <Image Self="ue6" ItemTransform="1 0 0 1 -150 -100"> + <Properties> + <Profile type="string"> + $ID/Embedded + </Profile> + </Properties> + <Link Self="ueb" LinkResourceURI="file:command/SVG_logo.svg" /> + </Image> + </Rectangle> + </CharacterStyleRange> +</ParagraphStyleRange> +``` + +``` +% pandoc -f latex -t icml +\includegraphics{command/SVG_logo-without-xml-declaration.svg} +^D +[WARNING] Could not determine image size for 'command/SVG_logo-without-xml-declaration.svg': could not determine SVG size +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100"> + <Properties> + <PathGeometry> + <GeometryPathType PathOpen="false"> + <PathPointArray> + <PathPointType Anchor="-150 -100" LeftDirection="-150 -100" RightDirection="-150 -100" /> + <PathPointType Anchor="-150 100" LeftDirection="-150 100" RightDirection="-150 100" /> + <PathPointType Anchor="150 100" LeftDirection="150 100" RightDirection="150 100" /> + <PathPointType Anchor="150 -100" LeftDirection="150 -100" RightDirection="150 -100" /> + </PathPointArray> + </GeometryPathType> + </PathGeometry> + </Properties> + <Image Self="ue6" ItemTransform="1 0 0 1 -150 -100"> + <Properties> + <Profile type="string"> + $ID/Embedded + </Profile> + </Properties> + <Link Self="ueb" LinkResourceURI="file:command/SVG_logo-without-xml-declaration.svg" /> + </Image> + </Rectangle> + </CharacterStyleRange> +</ParagraphStyleRange> +``` + + +``` +% pandoc -f latex -t icml +\includegraphics{command/inkscape-cube.svg} +^D +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 54.75 -65.25"> + <Properties> + <PathGeometry> + <GeometryPathType PathOpen="false"> + <PathPointArray> + <PathPointType Anchor="-54.75 -65.25" LeftDirection="-54.75 -65.25" RightDirection="-54.75 -65.25" /> + <PathPointType Anchor="-54.75 65.25" LeftDirection="-54.75 65.25" RightDirection="-54.75 65.25" /> + <PathPointType Anchor="54.75 65.25" LeftDirection="54.75 65.25" RightDirection="54.75 65.25" /> + <PathPointType Anchor="54.75 -65.25" LeftDirection="54.75 -65.25" RightDirection="54.75 -65.25" /> + </PathPointArray> + </GeometryPathType> + </PathGeometry> + </Properties> + <Image Self="ue6" ItemTransform="1 0 0 1 -54.75 -65.25"> + <Properties> + <Profile type="string"> + $ID/Embedded + </Profile> + </Properties> + <Link Self="ueb" LinkResourceURI="file:command/inkscape-cube.svg" /> + </Image> + </Rectangle> + </CharacterStyleRange> +</ParagraphStyleRange> +``` + diff --git a/test/command/tabularx.md b/test/command/tabularx.md new file mode 100644 index 000000000..bf7670e9c --- /dev/null +++ b/test/command/tabularx.md @@ -0,0 +1,110 @@ +``` +% pandoc -f latex -t native --quiet +\begin{tabularx}{\linewidth}{|c|c|c|} +\hline + Column Heading 1 + & Column Heading 2 + & Column Heading 3 \\ +\hline + Cell 1.1 + & Cell 1.2 + & Cell 1.3 \\ +\hline + Cell 2.1 + & Cell 2.2 + & Cell 2.3 \\ +\hline + Cell 3.1 + & Cell 3.2 + & Cell 3.3 \\ +\hline +\end{tabularx} +^D +[Table [] [AlignCenter,AlignCenter,AlignCenter] [0.0,0.0,0.0] + [[Plain [Str "Column",Space,Str "Heading",Space,Str "1"]] + ,[Plain [Str "Column",Space,Str "Heading",Space,Str "2"]] + ,[Plain [Str "Column",Space,Str "Heading",Space,Str "3"]]] + [[[Plain [Str "Cell",Space,Str "1.1"]] + ,[Plain [Str "Cell",Space,Str "1.2"]] + ,[Plain [Str "Cell",Space,Str "1.3"]]] + ,[[Plain [Str "Cell",Space,Str "2.1"]] + ,[Plain [Str "Cell",Space,Str "2.2"]] + ,[Plain [Str "Cell",Space,Str "2.3"]]] + ,[[Plain [Str "Cell",Space,Str "3.1"]] + ,[Plain [Str "Cell",Space,Str "3.2"]] + ,[Plain [Str "Cell",Space,Str "3.3"]]]]] +``` + +``` +% pandoc -f latex -t native --quiet +\begin{tabularx}{\linewidth}{|X|c|p{0.25\linewidth}|} +\hline + Column Heading 1 + & Column Heading 2 + & Column Heading 3 \\ +\hline + Cell 1.1 + & Cell 1.2 + & Cell 1.3 \\ +\hline + Cell 2.1 + & Cell 2.2 + & Cell 2.3 \\ +\hline + Cell 3.1 + & Cell 3.2 + & Cell 3.3 \\ +\hline +\end{tabularx} +^D +[Table [] [AlignLeft,AlignCenter,AlignLeft] [0.0,0.0,0.25] + [[Plain [Str "Column",Space,Str "Heading",Space,Str "1"]] + ,[Plain [Str "Column",Space,Str "Heading",Space,Str "2"]] + ,[Plain [Str "Column",Space,Str "Heading",Space,Str "3"]]] + [[[Plain [Str "Cell",Space,Str "1.1"]] + ,[Plain [Str "Cell",Space,Str "1.2"]] + ,[Plain [Str "Cell",Space,Str "1.3"]]] + ,[[Plain [Str "Cell",Space,Str "2.1"]] + ,[Plain [Str "Cell",Space,Str "2.2"]] + ,[Plain [Str "Cell",Space,Str "2.3"]]] + ,[[Plain [Str "Cell",Space,Str "3.1"]] + ,[Plain [Str "Cell",Space,Str "3.2"]] + ,[Plain [Str "Cell",Space,Str "3.3"]]]]] +``` + +``` +% pandoc -f latex -t native --quiet +\begin{tabularx}{\linewidth}{|b{0.25\linewidth}|c|m{0.25\linewidth}|} +\hline + Column Heading 1 + & Column Heading 2 + & Column Heading 3 \\ +\hline + Cell 1.1 + & Cell 1.2 + & Cell 1.3 \\ +\hline + Cell 2.1 + & Cell 2.2 + & Cell 2.3 \\ +\hline + Cell 3.1 + & Cell 3.2 + & Cell 3.3 \\ +\hline +\end{tabularx} +^D +[Table [] [AlignLeft,AlignCenter,AlignLeft] [0.25,0.0,0.25] + [[Plain [Str "Column",Space,Str "Heading",Space,Str "1"]] + ,[Plain [Str "Column",Space,Str "Heading",Space,Str "2"]] + ,[Plain [Str "Column",Space,Str "Heading",Space,Str "3"]]] + [[[Plain [Str "Cell",Space,Str "1.1"]] + ,[Plain [Str "Cell",Space,Str "1.2"]] + ,[Plain [Str "Cell",Space,Str "1.3"]]] + ,[[Plain [Str "Cell",Space,Str "2.1"]] + ,[Plain [Str "Cell",Space,Str "2.2"]] + ,[Plain [Str "Cell",Space,Str "2.3"]]] + ,[[Plain [Str "Cell",Space,Str "3.1"]] + ,[Plain [Str "Cell",Space,Str "3.2"]] + ,[Plain [Str "Cell",Space,Str "3.3"]]]]] +``` diff --git a/test/command/translations.md b/test/command/translations.md new file mode 100644 index 000000000..34531df7c --- /dev/null +++ b/test/command/translations.md @@ -0,0 +1,29 @@ +``` +% pandoc -f latex -t native -M lang=en +\figurename\ 2 +^D +[Para [Str "Figure\160\&2"]] +``` + +``` +% pandoc -f latex -t native -M lang=de-DE +\figurename\ 2 +^D +[Para [Str "Abbildung\160\&2"]] +``` + +``` +% pandoc -f latex -t native -M lang=en +\setmainlanguage{german} +\figurename 2 +^D +[Para [Str "Abbildung2"]] +``` + +``` +% pandoc -f latex -t native -M lang=sr +\figurename~2 +\figurename. +^D +[Para [Str "Slika\160\&2",SoftBreak,Str "Slika."]] +``` diff --git a/test/command/vars-and-metadata.md b/test/command/vars-and-metadata.md new file mode 100644 index 000000000..c3dc895af --- /dev/null +++ b/test/command/vars-and-metadata.md @@ -0,0 +1,15 @@ +Variables should not leak into metadata in the Markdown writer: + +``` +% pandoc -t markdown -Vfoo=1 -Vbar=2 -s +--- +foo: x +... +zib +^D +--- +foo: x +--- + +zib +``` diff --git a/test/command/write18.md b/test/command/write18.md new file mode 100644 index 000000000..344dfc8cf --- /dev/null +++ b/test/command/write18.md @@ -0,0 +1,14 @@ +Handle \write18{..} as raw tex: +``` +% pandoc -t native +\write18{git --version} +^D +[RawBlock (Format "latex") "\\write18{git --version}"] +``` + +``` +% pandoc -f latex+raw_tex -t native +\write18{git --version} +^D +[RawBlock (Format "latex") "\\write18{git --version}"] +``` diff --git a/test/command/yaml-with-chomp.md b/test/command/yaml-with-chomp.md new file mode 100644 index 000000000..d4c4f7cfd --- /dev/null +++ b/test/command/yaml-with-chomp.md @@ -0,0 +1,12 @@ +``` +% pandoc -s -t native +--- +ml: |- + TEST + + BLOCK +... +^D +Pandoc (Meta {unMeta = fromList [("ml",MetaBlocks [Para [Str "TEST"],Plain [Str "BLOCK"]])]}) +[] +``` |