diff options
Diffstat (limited to 'test/command')
57 files changed, 1132 insertions, 30 deletions
diff --git a/test/command/1126.md b/test/command/1126.md new file mode 100644 index 000000000..014a8ae2d --- /dev/null +++ b/test/command/1126.md @@ -0,0 +1,29 @@ +``` +% pandoc -f html -t latex +\begin{eqnarray} +A&=&B,\\ +C&=&D +\end{eqnarray} +^D +\textbackslash{}begin\{eqnarray\} +A\&=\&B,\textbackslash{}\textbackslash{} C\&=\&D +\textbackslash{}end\{eqnarray\} +``` + +``` +% pandoc -f html+raw_tex -t latex +<p>See \eqref{myeq}.</p> +\begin{eqnarray} +A&=&B,\\ +C&=&D +\\label{myeq} +\end{eqnarray} +^D +See \eqref{myeq}. + +\begin{eqnarray} +A&=&B,\\ +C&=&D +\\label{myeq} +\end{eqnarray} +``` diff --git a/test/command/1710.md b/test/command/1710.md index d20dfe191..4d9c64b30 100644 --- a/test/command/1710.md +++ b/test/command/1710.md @@ -58,7 +58,7 @@ ok \protect\hypertarget{slide-one}{} \begin{columns}[T] -\begin{column}{0.40\textwidth} +\begin{column}{0.4\textwidth} \begin{itemize} \tightlist \item @@ -68,7 +68,7 @@ ok \end{itemize} \end{column} -\begin{column}{0.40\textwidth} +\begin{column}{0.4\textwidth} \begin{itemize} \tightlist \item @@ -78,11 +78,10 @@ ok \end{itemize} \end{column} -\begin{column}{0.10\textwidth} +\begin{column}{0.1\textwidth} ok \end{column} \end{columns} \end{frame} ``` - diff --git a/test/command/2118.md b/test/command/2118.md index 27b3723d3..9730dd383 100644 --- a/test/command/2118.md +++ b/test/command/2118.md @@ -7,5 +7,5 @@ \label{fig:setminus} \end{figure} ^D -[Para [Image ("",[],[("width","80%")]) [Str "Set",Space,Str "subtraction",Span ("",[],[("label","fig:setminus")]) []] ("setminus.png","fig:")]] +[Para [Image ("fig:setminus",[],[("width","80%")]) [Str "Set",Space,Str "subtraction",Span ("",[],[("label","fig:setminus")]) []] ("setminus.png","fig:")]] ``` diff --git a/test/command/3407.md b/test/command/3407.md index 3160d1263..aec253ff5 100644 --- a/test/command/3407.md +++ b/test/command/3407.md @@ -1,6 +1,6 @@ ``` % pandoc -f native -t rst -[Para [Span ("",[],[("role","foo")]) [Str "text"]]] +[Para [Code ("",["interpreted-text"],[("role","foo")]) "text"]] ^D :foo:`text` ``` @@ -9,5 +9,5 @@ % pandoc -f rst -t native :foo:`text` ^D -[Para [Span ("",[],[("role","foo")]) [Str "text"]]] +[Para [Code ("",["interpreted-text"],[("role","foo")]) "text"]] ``` diff --git a/test/command/3432.md b/test/command/3432.md index 7264d22c3..381f8af87 100644 --- a/test/command/3432.md +++ b/test/command/3432.md @@ -195,7 +195,7 @@ List-table without header-rows. </table> ``` -List-table with empty cells. You need a space after '-', otherwise the row will disapear. Parser for Bulletlists causes this ristriction. +List-table with empty cells. You need a space after '-', otherwise the row will disappear. Parser for Bulletlists causes this restriction. ``` % pandoc -f rst diff --git a/test/command/3534.md b/test/command/3534.md index 89224551b..cd0915d88 100644 --- a/test/command/3534.md +++ b/test/command/3534.md @@ -21,3 +21,25 @@ I want to explain the interface of \lstinline[language=Java]{public class MyClas [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 "."]] ``` +``` +% pandoc -f latex -t html +I want to explain the interface of \mintinline{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 \mintinline{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 native +I want to explain the interface of \mintinline[linenos]{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/3558.md b/test/command/3558.md index 795858b78..956b09e57 100644 --- a/test/command/3558.md +++ b/test/command/3558.md @@ -6,7 +6,7 @@ hello \endmulti ^D -[RawBlock (Format "latex") "\\multi" +[RawBlock (Format "tex") "\\multi" ,Para [Str "hello"] -,RawBlock (Format "latex") "\\endmulti"] +,RawBlock (Format "tex") "\\endmulti"] ``` diff --git a/test/command/3716.md b/test/command/3716.md index 7e00819da..81e4a9568 100644 --- a/test/command/3716.md +++ b/test/command/3716.md @@ -2,5 +2,5 @@ % pandoc <http://example.com>{.foo} ^D -<p><a href="http://example.com" class="uri foo">http://example.com</a></p> +<p><a href="http://example.com" class="foo">http://example.com</a></p> ``` diff --git a/test/command/3804.md b/test/command/3804.md index c13c2ef42..520d408df 100644 --- a/test/command/3804.md +++ b/test/command/3804.md @@ -2,5 +2,5 @@ % 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}"] +[RawBlock (Format "tex") "\\titleformat{\\chapter}[display]{\\normalfont\\large\\bfseries}{\31532\\thechapter{}\31456}{20pt}{\\Huge}"] ``` diff --git a/test/command/3947.md b/test/command/3947.md index 7ce0be171..b1d695fbd 100644 --- a/test/command/3947.md +++ b/test/command/3947.md @@ -6,6 +6,6 @@ Another Code block ^D -[RawBlock (Format "latex") "\\newpage" +[RawBlock (Format "tex") "\\newpage" ,CodeBlock ("",[],[]) "Code block\n\nAnother Code block"] ``` diff --git a/test/command/4016.md b/test/command/4016.md index 3918251c6..5e4e35e0d 100644 --- a/test/command/4016.md +++ b/test/command/4016.md @@ -17,7 +17,7 @@ pandoc -t beamer \protect\hypertarget{level-2-blocks}{} \begin{columns}[T] -\begin{column}{0.40\textwidth} +\begin{column}{0.4\textwidth} \begin{block}{Block one} \begin{itemize} @@ -29,7 +29,7 @@ pandoc -t beamer \end{block} \end{column} -\begin{column}{0.60\textwidth} +\begin{column}{0.6\textwidth} \begin{block}{Block two} \begin{itemize} diff --git a/test/command/4056.md b/test/command/4056.md index eed4f6d6a..e972931dd 100644 --- a/test/command/4056.md +++ b/test/command/4056.md @@ -5,7 +5,7 @@ \end{shaded} } ^D -[RawBlock (Format "latex") "\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}"] +[RawBlock (Format "tex") "\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}"] ``` ``` diff --git a/test/command/4159.md b/test/command/4159.md index 4881edcc5..d61959950 100644 --- a/test/command/4159.md +++ b/test/command/4159.md @@ -3,6 +3,6 @@ \newcommand{\gen}{a\ Gen\ b} abc ^D -[RawBlock (Format "latex") "\\newcommand{\\gen}{a\\ Gen\\ b}" +[RawBlock (Format "tex") "\\newcommand{\\gen}{a\\ Gen\\ b}" ,Para [Str "abc"]] ``` diff --git a/test/command/4284.md b/test/command/4284.md new file mode 100644 index 000000000..eddd1b03a --- /dev/null +++ b/test/command/4284.md @@ -0,0 +1,40 @@ +``` +% pandoc -f org -t native +#+EXCLUDE_TAGS:apple cat bye dog % + +* This should not appear :apple: +* NOEXPORT should appear if not specified in EXCLUDE_TAGS :noexport: +* This should not appear :cat:hi:laptop: +** Children of headers with excluded tags should not appear :xylophone: +* This should not appear :%: +^D +[Header 1 ("noexport-should-appear-if-not-specified-in-excludetags",[],[]) [Str "NOEXPORT",Space,Str "should",Space,Str "appear",Space,Str "if",Space,Str "not",Space,Str "specified",Space,Str "in",Space,Str "EXCLUDE",Subscript [Str "TAGS"],Space,Span ("",["tag"],[("tag-name","noexport")]) [SmallCaps [Str "noexport"]]]] +``` + +``` +% pandoc -f org -t native +#+EXCLUDE_TAGS:elephant +* This should not appear :elephant: +* This should appear :fawn: +^D +[Header 1 ("this-should-appear",[],[]) [Str "This",Space,Str "should",Space,Str "appear",Space,Span ("",["tag"],[("tag-name","fawn")]) [SmallCaps [Str "fawn"]]]] +``` + +``` +% pandoc -f org -t native +#+EXCLUDE_TAGS: giraffe +#+EXCLUDE_TAGS: hippo +* This should not appear :giraffe: +* This should not appear :hippo: +* This should appear :noexport: +^D +[Header 1 ("this-should-appear",[],[]) [Str "This",Space,Str "should",Space,Str "appear",Space,Span ("",["tag"],[("tag-name","noexport")]) [SmallCaps [Str "noexport"]]]] +``` + +``` +% pandoc -f org -t native +#+EXCLUDE_TAGS: +* NOEXPORT should appear if not specified in EXCLUDE_TAGS :noexport: +^D +[Header 1 ("noexport-should-appear-if-not-specified-in-excludetags",[],[]) [Str "NOEXPORT",Space,Str "should",Space,Str "appear",Space,Str "if",Space,Str "not",Space,Str "specified",Space,Str "in",Space,Str "EXCLUDE",Subscript [Str "TAGS"],Space,Span ("",["tag"],[("tag-name","noexport")]) [SmallCaps [Str "noexport"]]]] +``` diff --git a/test/command/4528.md b/test/command/4528.md new file mode 100644 index 000000000..a60f6decf --- /dev/null +++ b/test/command/4528.md @@ -0,0 +1,156 @@ +# Rendering small caps, superscripts and subscripts with and without `raw_html` + +## Small caps + +``` +% pandoc --wrap=none -f latex -t commonmark-raw_html +This has \textsc{small caps} in it. +^D +This has SMALL CAPS in it. +``` + +``` +% pandoc --wrap=none -f latex -t commonmark+raw_html +This has \textsc{small caps} in it. +^D +This has <span class="smallcaps">small caps</span> in it. +``` +``` + +``` +% pandoc --wrap=none -f latex -t markdown_strict+raw_html +This has \textsc{small caps} in it. +^D +This has <span class="smallcaps">small caps</span> in it. +``` + +## Strikeout + +``` +% pandoc --wrap=none -f html -t commonmark-raw_html-strikeout +This has <s>strikeout</s> in it. +^D +This has strikeout in it. + +``` +% pandoc --wrap=none -f html -t commonmark+raw_html-strikeout +This has <s>strikeout</s> in it. +^D +This has <s>strikeout</s> in it. +``` + +``` +% pandoc --wrap=none -f html -t commonmark-raw_html+strikeout +This has <s>strikeout</s> in it. +^D +This has ~~strikeout~~ in it. +``` + +``` +% pandoc --wrap=none -f html -t commonmark+raw_html+strikeout +This has <s>strikeout</s> in it. +^D +This has ~~strikeout~~ in it. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict-raw_html-strikeout +This has <s>strikeout</s> in it. +^D +This has strikeout in it. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict+raw_html-strikeout +This has <s>strikeout</s> in it. +^D +This has <s>strikeout</s> in it. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict-raw_html+strikeout +This has <s>strikeout</s> in it. +^D +This has ~~strikeout~~ in it. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict+raw_html+strikeout +This has <s>strikeout</s> in it. +^D +This has ~~strikeout~~ in it. +``` + +## Superscript + +``` +% pandoc --wrap=none -f html -t commonmark-raw_html +This has <sup>superscript</sup> in it and <sup>2 3</sup> again. With emphasis: <sup><em>2</em> 3</sup>. With letters: <sup>foo</sup>. With a span: <sup><span class=foo>2</span></sup>. +^D +This has ^(superscript) in it and ² ³ again. With emphasis: ^(*2* 3). With letters: ^(foo). With a span: ². +``` + +``` +% pandoc --wrap=none -f html -t commonmark+raw_html +This has <sup>superscript</sup> in it and <sup>2</sup> again. +^D +This has <sup>superscript</sup> in it and <sup>2</sup> again. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict-raw_html-superscript +This has <sup>superscript</sup> in it and <sup>2</sup> again. +^D +This has ^(superscript) in it and ² again. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict+raw_html-superscript +This has <sup>superscript</sup> in it and <sup>2</sup> again. +^D +This has <sup>superscript</sup> in it and <sup>2</sup> again. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict+raw_html+superscript +This has <sup>superscript</sup> in it and <sup>2</sup> again. +^D +This has ^superscript^ in it and ^2^ again. +``` + +## Subscript + +``` +% pandoc --wrap=none -f html -t commonmark-raw_html +This has <sub>subscript</sub> in it and <sub>2 3</sub> again. With emphasis: <sub><em>2</em> 3</sub>. With letters: <sub>foo</sub>. With a span: <sub><span class=foo>2</span></sub>. +^D +This has \_(subscript) in it and ₂ ₃ again. With emphasis: \_(*2* 3). With letters: \_(foo). With a span: ₂. +``` + +``` +% pandoc --wrap=none -f html -t commonmark+raw_html +This has <sub>subscript</sub> in it and <sub>2</sub> again. +^D +This has <sub>subscript</sub> in it and <sub>2</sub> again. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict-raw_html-subscript +This has <sub>subscript</sub> in it and <sub>2</sub> again. +^D +This has _(subscript) in it and ₂ again. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict+raw_html-subscript +This has <sub>subscript</sub> in it and <sub>2</sub> again. +^D +This has <sub>subscript</sub> in it and <sub>2</sub> again. +``` + +``` +% pandoc --wrap=none -f html -t markdown_strict+raw_html+subscript +This has <sub>subscript</sub> in it and <sub>2</sub> again. +^D +This has ~subscript~ in it and ~2~ again. +``` diff --git a/test/command/4545.md b/test/command/4545.md new file mode 100644 index 000000000..e5fc6e244 --- /dev/null +++ b/test/command/4545.md @@ -0,0 +1,20 @@ +``` +% pandoc -t asciidoc +Test 1 + +[my text] + +Test 2 +^D +Test 1 + +{empty}[my text] + +Test 2 +``` +``` +% pandoc -t asciidoc +4\. foo +^D +{empty}4. foo +``` diff --git a/test/command/4553.md b/test/command/4553.md new file mode 100644 index 000000000..e5122d4d9 --- /dev/null +++ b/test/command/4553.md @@ -0,0 +1,15 @@ +``` +pandoc -f latex -t native +foo \include{command/bar} +^D +[Para [Str "foo"] +,Para [Emph [Str "hi",Space,Str "there"]]] +``` + +``` +pandoc -f latex -t native +foo \input{command/bar} +^D +[Para [Str "foo",Space,Emph [Str "hi",Space,Str "there"]]] +``` + diff --git a/test/command/4624.md b/test/command/4624.md new file mode 100644 index 000000000..f9aa45596 --- /dev/null +++ b/test/command/4624.md @@ -0,0 +1,30 @@ +``` +% pandoc -f latex -t native +\begin{Verbatim}[key1=value1] +code1 + +\end{Verbatim} + + +\begin{lstlisting}[key2=value2] +code2 + +\end{lstlisting} + +\begin{verbatim} +code3 +\end{verbatim} + +\begin{verbatim} +code4 + \end{verbatim} + +\begin{verbatim} +code5\end{verbatim} +^D +[CodeBlock ("",[],[("key1","value1")]) "code1\n" +,CodeBlock ("",[],[("key2","value2")]) "code2\n " +,CodeBlock ("",[],[]) "code3" +,CodeBlock ("",[],[]) "code4" +,CodeBlock ("",[],[]) "code5"] +``` diff --git a/test/command/4653.md b/test/command/4653.md new file mode 100644 index 000000000..24a706e89 --- /dev/null +++ b/test/command/4653.md @@ -0,0 +1,8 @@ +``` +% pandoc -t latex +\let\tex\TeX +\renewcommand{\TeX}{\tex\xspace} +^D +\let\tex\TeX +\renewcommand{\TeX}{\tex\xspace} +``` diff --git a/test/command/4667.md b/test/command/4667.md new file mode 100644 index 000000000..1fff3708d --- /dev/null +++ b/test/command/4667.md @@ -0,0 +1,20 @@ +``` +pandoc -t latex +--- +header-includes: +- \newcommand{\blandscape}{\begin{landscape}} +- \newcommand{\elandscape}{\end{landscape}} +... + +\blandscape + +testing + +\elandscape +^D +\begin{landscape} + +testing + +\end{landscape} +``` diff --git a/test/command/4669.md b/test/command/4669.md new file mode 100644 index 000000000..b9db45b17 --- /dev/null +++ b/test/command/4669.md @@ -0,0 +1,29 @@ +``` +% pandoc -f latex -t native +{\tt <-} + +\begin{verbatim} + while (n > 0) { +\end{verbatim} +^D +[Para [Span ("",[],[]) [Str "<-"]] +,CodeBlock ("",[],[]) " while (n > 0) {"] +``` + +``` +% pandoc -f latex -t native +\begin{itemize} +\item<1> one +\item<2-3,5> two +\item<2| @alert> three +\item<handout> four +\item<beamer:2> five +\end{itemize} +^D +[BulletList + [[Para [Str "one"]] + ,[Para [Str "two"]] + ,[Para [Str "three"]] + ,[Para [Str "four"]] + ,[Para [Str "five"]]]] +``` diff --git a/test/command/4677.md b/test/command/4677.md new file mode 100644 index 000000000..0343cf42a --- /dev/null +++ b/test/command/4677.md @@ -0,0 +1,8 @@ +``` +% pandoc --to "markdown-bracketed_spans-fenced_divs-link_attributes-simple_tables-multiline_tables-grid_tables-pipe_tables-fenced_code_attributes-markdown_in_html_blocks-table_captions-smart" +![Caption](img.png){#img:1} +^D +<figure> +<img src="img.png" alt="Caption" id="img:1" /><figcaption>Caption</figcaption> +</figure> +``` diff --git a/test/command/4690.md b/test/command/4690.md new file mode 100644 index 000000000..deccfba13 --- /dev/null +++ b/test/command/4690.md @@ -0,0 +1,28 @@ +``` +% pandoc -t beamer +# title + +:::: {.columns} +::: {.column width="8%"} +content +::: +::: {.column width="84%"} +content2 +::: +:::: +^D +\begin{frame}{title} +\protect\hypertarget{title}{} + +\begin{columns}[T] +\begin{column}{0.08\textwidth} +content +\end{column} + +\begin{column}{0.84\textwidth} +content2 +\end{column} +\end{columns} + +\end{frame} +``` diff --git a/test/command/4722.md b/test/command/4722.md new file mode 100644 index 000000000..6c8c14716 --- /dev/null +++ b/test/command/4722.md @@ -0,0 +1,34 @@ +``` +% pandoc -f tikiwiki -t native +*Level 1 +*Level 1 +**Level 2 +***Level 3 +*Level 1 +^D +[BulletList + [[Plain [Str "Level",Space,Str "1"]] + ,[Plain [Str "Level",Space,Str "1"] + ,BulletList + [[Plain [Str "Level",Space,Str "2"] + ,BulletList + [[Plain [Str "Level",Space,Str "3"]]]]]] + ,[Plain [Str "Level",Space,Str "1"]]]] +``` +``` +% pandoc -f tikiwiki -t native +#Level 1 +#Level 1 +##Level 2 +###Level 3 +#Level 1 +^D +[OrderedList (1,DefaultStyle,DefaultDelim) + [[Plain [Str "Level",Space,Str "1"]] + ,[Plain [Str "Level",Space,Str "1"] + ,OrderedList (1,DefaultStyle,DefaultDelim) + [[Plain [Str "Level",Space,Str "2"] + ,OrderedList (1,DefaultStyle,DefaultDelim) + [[Plain [Str "Level",Space,Str "3"]]]]]] + ,[Plain [Str "Level",Space,Str "1"]]]] +``` diff --git a/test/command/4742.md b/test/command/4742.md new file mode 100644 index 000000000..72751d727 --- /dev/null +++ b/test/command/4742.md @@ -0,0 +1,25 @@ +Check that the commonmark reader handles the `ascii_identifiers` +extension properly. + +``` +% pandoc -f commonmark+gfm_auto_identifiers+ascii_identifiers -t native +# non ascii ⚠️ räksmörgås +^D +[Header 1 ("non-ascii--raksmorgas",[],[]) [Str "non",Space,Str "ascii",Space,Str "\9888\65039",Space,Str "r\228ksm\246rg\229s"]] +``` + +``` +% pandoc -f commonmark+gfm_auto_identifiers-ascii_identifiers -t native +# non ascii ⚠️ räksmörgås +^D +[Header 1 ("non-ascii-\65039-r\228ksm\246rg\229s",[],[]) [Str "non",Space,Str "ascii",Space,Str "\9888\65039",Space,Str "r\228ksm\246rg\229s"]] +``` + +`gfm` should have `ascii_identifiers` enabled by default. + +``` +% pandoc -f gfm -t native +# non ascii ⚠️ räksmörgås +^D +[Header 1 ("non-ascii--raksmorgas",[],[]) [Str "non",Space,Str "ascii",Space,Str "\9888\65039",Space,Str "r\228ksm\246rg\229s"]] +``` diff --git a/test/command/4743.md b/test/command/4743.md new file mode 100644 index 000000000..49b4b6d59 --- /dev/null +++ b/test/command/4743.md @@ -0,0 +1,25 @@ +Test that emojis are wrapped in Span + +``` +% pandoc -f commonmark+emoji -t native +My:thumbsup:emoji:heart: +^D +[Para [Str "My",Span ("",["emoji"],[("data-emoji","thumbsup")]) [Str "\128077"],Str "emoji",Span ("",["emoji"],[("data-emoji","heart")]) [Str "\10084\65039"]]] +``` + +``` +% pandoc -f markdown+emoji -t native +My:thumbsup:emoji:heart: +^D +[Para [Str "My",Span ("",["emoji"],[("data-emoji","thumbsup")]) [Str "\128077"],Str "emoji",Span ("",["emoji"],[("data-emoji","heart")]) [Str "\10084\65039"]]] +``` + +``` +% pandoc -f commonmark+emoji -t html +:zero: header +============= +My:thumbsup:emoji:heart:x :hearts: xyz +^D +<h1><span class="emoji" data-emoji="zero">0️⃣</span> header</h1> +<p>My<span class="emoji" data-emoji="thumbsup">👍</span>emoji<span class="emoji" data-emoji="heart">❤️</span>x <span class="emoji" data-emoji="hearts">♥️</span> xyz</p> +``` diff --git a/test/command/4748.md b/test/command/4748.md new file mode 100644 index 000000000..1de0fa9ed --- /dev/null +++ b/test/command/4748.md @@ -0,0 +1,16 @@ +``` +% pandoc -f org -t rst +Before example block. +#+begin_example +This is in an example block. +#+end_example +After example block. +^D +Before example block. + +:: + + This is in an example block. + +After example block. +``` diff --git a/test/command/4768.md b/test/command/4768.md new file mode 100644 index 000000000..60d407d8b --- /dev/null +++ b/test/command/4768.md @@ -0,0 +1,7 @@ +``` +% pandoc -f latex -t plain +\def\foo#1!#2!#3{#1 or #2 and #3} +\foo aa!bbb bbb!{ccc} +^D +aa or bbb bbb and ccc +``` diff --git a/test/command/4781.md b/test/command/4781.md new file mode 100644 index 000000000..8a75e09a0 --- /dev/null +++ b/test/command/4781.md @@ -0,0 +1,22 @@ +``` +% pandoc -t native +Markdown parsed *here* + +\include{command/bar} + +*But not here* +^D +[Para [Str "Markdown",Space,Str "parsed",Space,Emph [Str "here"]] +,RawBlock (Format "tex") "\\include{command/bar}" +,Para [Emph [Str "But",Space,Str "not",Space,Str "here"]]] +``` + +``` +% pandoc -t native +*here* \input{command/bar} + +*But not here* +^D +[Para [Emph [Str "here"],Space,RawInline (Format "tex") "\\input{command/bar}"] +,Para [Emph [Str "But",Space,Str "not",Space,Str "here"]]] +``` diff --git a/test/command/4794.md b/test/command/4794.md new file mode 100644 index 000000000..8356d2157 --- /dev/null +++ b/test/command/4794.md @@ -0,0 +1,18 @@ +``` +% pandoc -f markdown -t mediawiki +| Column1 | Column2 | Column3 | +| ------- | ------- | ------- | +| text | | text | +^D +{| +! Column1 +! Column2 +! Column3 +|- +| text +| +| text +|} + + +``` diff --git a/test/command/4811.md b/test/command/4811.md new file mode 100644 index 000000000..9c8bea7ce --- /dev/null +++ b/test/command/4811.md @@ -0,0 +1,48 @@ +No blank lines in inline interpreted roles: + +``` +% pandoc -f rst -t native +`no + +blank`:myrole: +^D +[Para [Str "`no"] +,Para [Str "blank`:myrole:"]] +``` + +Backslash escape behaves properly in interpreted roles: + +``` +% pandoc -f rst -t native +`hi\ there`:sup: + +`hi\ there`:code: +^D +[Para [Superscript [Str "hithere"]] +,Para [Code ("",["sourceCode"],[]) "hi\\ there"]] +``` + +Backtick followed by alphanumeric doesn't end the span: +``` +% pandoc -f rst -t native +`hi`there`:myrole: +^D +[Para [Code ("",["interpreted-text"],[("role","myrole")]) "hi`there"]] +``` + +Newline is okay, as long as not blank: +``` +% pandoc -f rst -t native +`hi +there`:myrole: +^D +[Para [Code ("",["interpreted-text"],[("role","myrole")]) "hi\nthere"]] +``` + +Use span for title-reference: +``` +% pandoc -f rst -t native +`default` +^D +[Para [Span ("",["title-ref"],[]) [Str "default"]]] +``` diff --git a/test/command/4817.md b/test/command/4817.md new file mode 100644 index 000000000..7718e3b3a --- /dev/null +++ b/test/command/4817.md @@ -0,0 +1,10 @@ +``` +% pandoc -t native -s +--- +foo: +- bar: bam +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaList [MetaMap (fromList [("bar",MetaInlines [Str "bam"])])])]}) +[] +``` diff --git a/test/command/4819.md b/test/command/4819.md new file mode 100644 index 000000000..548583387 --- /dev/null +++ b/test/command/4819.md @@ -0,0 +1,50 @@ +``` +% pandoc -f markdown -t native -s +--- +foo: 42 +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaInlines [Str "42"])]}) +[] +``` + +``` +% pandoc -f markdown -t native -s +--- +foo: true +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaBool True)]}) +[] +``` + +``` +% pandoc -f markdown -t native -s +--- +foo: True +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaBool True)]}) +[] +``` + +``` +% pandoc -f markdown -t native -s +--- +foo: FALSE +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaBool False)]}) +[] +``` + +``` +% pandoc -f markdown -t native -s +--- +foo: no +... +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaInlines [Str "no"])]}) +[] +``` + diff --git a/test/command/4832.md b/test/command/4832.md new file mode 100644 index 000000000..9ba40804c --- /dev/null +++ b/test/command/4832.md @@ -0,0 +1,21 @@ +``` +% pandoc -f latex -t native +\url{http://example.com/foo%20bar.htm} +^D +[Para [Link ("",[],[]) [Str "http://example.com/foo%20bar.htm"] ("http://example.com/foo%20bar.htm","")]] +``` + +``` +% pandoc -f latex -t native +\url{http://example.com/foo{bar}.htm} +^D +[Para [Link ("",[],[]) [Str "http://example.com/foo{bar}.htm"] ("http://example.com/foo{bar}.htm","")]] +``` + +``` +% pandoc -f latex -t native +\href{http://example.com/foo%20bar}{Foobar} +^D +[Para [Link ("",[],[]) [Str "Foobar"] ("http://example.com/foo%20bar","")]] +``` + diff --git a/test/command/4833.md b/test/command/4833.md new file mode 100644 index 000000000..ed6de606b --- /dev/null +++ b/test/command/4833.md @@ -0,0 +1,20 @@ +``` +pandoc -f native -t rst +[Div ("",["warning"],[]) + [Div ("",["admonition-title"],[]) + [Para [Str "Warning"]] + ,Para [Str "Hi"]]] +^D +.. warning:: + + Hi +``` +``` +pandoc -f native -t rst +[Div ("",["unknown"],[]) + [Para [Str "Hi"]]] +^D +.. container:: unknown + + Hi +``` diff --git a/test/command/4842.md b/test/command/4842.md new file mode 100644 index 000000000..a311739b7 --- /dev/null +++ b/test/command/4842.md @@ -0,0 +1,6 @@ +``` +pandoc -f latex -t native +\l +^D +[Para [Str "\322"]] +``` diff --git a/test/command/4845.md b/test/command/4845.md new file mode 100644 index 000000000..093161ac7 --- /dev/null +++ b/test/command/4845.md @@ -0,0 +1,6 @@ +``` +% pandoc -f html -t native +x<a href="/foo"> leading trailing space </a>x +^D +[Plain [Str "x",Space,Link ("",[],[]) [Str "leading",Space,Str "trailing",Space,Str "space"] ("/foo",""),Space,Str "x"]] +``` diff --git a/test/command/4848.md b/test/command/4848.md new file mode 100644 index 000000000..2cd2bab34 --- /dev/null +++ b/test/command/4848.md @@ -0,0 +1,59 @@ +``` +% pandoc -f latex -t native +\enquote*{hi} +^D +[Para [Quoted SingleQuote [Str "hi"]]] +``` + +``` +% pandoc -f latex -t native +\foreignquote{italian}{hi} +^D +[Para [Quoted DoubleQuote [Span ("",[],[("lang","it")]) [Str "hi"]]]] +``` + +``` +% pandoc -f latex -t native +\hyphenquote*{italian}{hi} +^D +[Para [Quoted SingleQuote [Span ("",[],[("lang","it")]) [Str "hi"]]]] +``` + +``` +% pandoc -f latex -t native +Lorem ipsum +\blockquote{dolor sit amet} +consectetuer. +^D +[Para [Str "Lorem",Space,Str "ipsum"] +,BlockQuote + [Para [Str "dolor",Space,Str "sit",Space,Str "amet"]] +,Para [Str "consectetuer."]] +``` + +``` +% pandoc -f latex -t native +Lorem ipsum +\blockcquote[198]{Knu86}{dolor sit amet} +consectetuer. +^D +[Para [Str "Lorem",Space,Str "ipsum"] +,BlockQuote + [Para [Str "dolor",Space,Str "sit",Space,Str "amet"] + ,Para [Cite [Citation {citationId = "Knu86", citationPrefix = [], citationSuffix = [Str "198"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] []]] +,Para [Str "consectetuer."]] +``` + +``` +% pandoc -f latex -t native +Lorem ipsum +\foreignblockquote{italian}{dolor sit amet} +consectetuer. +^D +[Para [Str "Lorem",Space,Str "ipsum"] +,BlockQuote + [Div ("",[],[("lang","it")]) + [Para [Str "dolor",Space,Str "sit",Space,Str "amet"]]] +,Para [Str "consectetuer."]] +``` + diff --git a/test/command/4860.md b/test/command/4860.md new file mode 100644 index 000000000..9198f68d7 --- /dev/null +++ b/test/command/4860.md @@ -0,0 +1,9 @@ +``` +% pandoc -f rst -t native +This is broken_. + +.. ***** REFERENCES FOLLOW ***** +.. _broken: http://google.com +^D +[Para [Str "This",Space,Str "is",Space,Link ("",[],[]) [Str "broken"] ("http://google.com",""),Str "."]] +``` diff --git a/test/command/4877.md b/test/command/4877.md new file mode 100644 index 000000000..070687345 --- /dev/null +++ b/test/command/4877.md @@ -0,0 +1,13 @@ +``` +% pandoc -f html -t native +My <script type="math/tex">\mathcal{D}</script> +^D +[Plain [Str "My",Space,Math InlineMath "\\mathcal{D}"]] +``` + +``` +% pandoc -f html -t native +<script type="math/tex; mode=display">\mathcal{D}</script> +^D +[Plain [Math DisplayMath "\\mathcal{D}"]] +``` diff --git a/test/command/4885.md b/test/command/4885.md new file mode 100644 index 000000000..8611097c2 --- /dev/null +++ b/test/command/4885.md @@ -0,0 +1,8 @@ +``` +% pandoc -f org -t markdown +This won't show the command. +src_maxima[:exports none :results raw]{tex('integrate(sin((e^x)/pi),x,0,inf));} $$\int_{0}^{\infty }{\sin \left({{e^{x}}\over{\pi}}\right)\;dx}$$ +^D +This won\'t show the command. +$$\int_{0}^{\infty }{\sin \left({{e^{x}}\over{\pi}}\right)\;dx}$$ +``` diff --git a/test/command/4908.md b/test/command/4908.md new file mode 100644 index 000000000..2ff1a4603 --- /dev/null +++ b/test/command/4908.md @@ -0,0 +1,16 @@ +``` +% pandoc -f markdown_mmd+fancy_lists+example_lists -t native -t plain +(@) Example one +(@) Example two + +some text + +(@) Example three +^D +(1) Example one +(2) Example two + +some text + +(3) Example three +``` diff --git a/test/command/4913.md b/test/command/4913.md new file mode 100644 index 000000000..6492b80ce --- /dev/null +++ b/test/command/4913.md @@ -0,0 +1,34 @@ +``` +% pandoc -f markdown -t html +[https://pandoc.org](https://pandoc.org) +^D +<p><a href="https://pandoc.org">https://pandoc.org</a></p> +``` + +``` +% pandoc -f markdown -t markdown +[https://pandoc.org](https://pandoc.org) +^D +<https://pandoc.org> +``` + +``` +% pandoc -f markdown -t html +<https://pandoc.org> +^D +<p><a href="https://pandoc.org" class="uri">https://pandoc.org</a></p> +``` + +``` +% pandoc -f markdown -t html +<https://pandoc.org>{.foo} +^D +<p><a href="https://pandoc.org" class="foo">https://pandoc.org</a></p> +``` + +``` +% pandoc -f markdown -t html +<me@example.com> +^D +<p><a href="mailto:me@example.com" class="email">me@example.com</a></p> +``` diff --git a/test/command/4919.md b/test/command/4919.md new file mode 100644 index 000000000..029d1beff --- /dev/null +++ b/test/command/4919.md @@ -0,0 +1,14 @@ +``` +% pandoc -f rst -t native +.. _`tgtmath`: + + .. math:: + :name: + + V = \frac{K}{r^2} +^D +[Div ("tgtmath",[],[]) + [BlockQuote + [Para [Math DisplayMath "V = \\frac{K}{r^2}"]]]] +``` + diff --git a/test/command/4928.md b/test/command/4928.md new file mode 100644 index 000000000..d1e2b6db7 --- /dev/null +++ b/test/command/4928.md @@ -0,0 +1,48 @@ +``` +% pandoc -f latex -t native +\cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72} +^D +[Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "Multiprenote",Space,Str "23"], citationSuffix = [Str "42"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "Nie72", citationPrefix = [], citationSuffix = [Str "65",Str ",",Space,Str "multipostnote"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}"]]] +``` + +``` +% pandoc -f latex -t native +\cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72} +^D +[Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "Multiprenote",Space,Str "23"], citationSuffix = [Str "42"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "Nie72", citationPrefix = [], citationSuffix = [Str "65"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72}"]]] +``` + +``` +% pandoc -f latex -t native +\cites()(multipostnote)[23][42]{Knu86}[65]{Nie72} +^D +[Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "23"], citationSuffix = [Str "42"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "Nie72", citationPrefix = [], citationSuffix = [Str "65",Str ",",Space,Str "multipostnote"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cites()(multipostnote)[23][42]{Knu86}[65]{Nie72}"]]] +``` + +``` +% pandoc -f latex -t native +\cites()()[23][42]{Knu86}[65]{Nie72} +^D +[Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "23"], citationSuffix = [Str "42"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "Nie72", citationPrefix = [], citationSuffix = [Str "65"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cites()()[23][42]{Knu86}[65]{Nie72}"]]] +``` + +``` +% pandoc -f latex -t native +\cites(multipostnote)[23][42]{Knu86}[65]{Nie72} +^D +[Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "23"], citationSuffix = [Str "42"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "Nie72", citationPrefix = [], citationSuffix = [Str "65",Str ",",Space,Str "multipostnote"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cites(multipostnote)[23][42]{Knu86}[65]{Nie72}"]]] +``` + +``` +% pandoc -f latex -t native +\cites(Multiprenote)(multipostnote){Knu86} +^D +[Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "Multiprenote"], citationSuffix = [Str ",",Space,Str "multipostnote"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cites(Multiprenote)(multipostnote){Knu86}"]]] +``` + +``` +% pandoc -f latex -t native +\footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72} +^D +[Para [Note [Para [Cite [Citation {citationId = "Knu86", citationPrefix = [Str "Multiprenote",Space,Str "23"], citationSuffix = [Str "42"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "Nie72", citationPrefix = [], citationSuffix = [Str "65",Str ",",Space,Str "multipostnote"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}"],Str "."]]]] +``` diff --git a/test/command/adjacent_latex_blocks.md b/test/command/adjacent_latex_blocks.md index 3e72f1d4f..e7dc6d895 100644 --- a/test/command/adjacent_latex_blocks.md +++ b/test/command/adjacent_latex_blocks.md @@ -4,6 +4,6 @@ \listoftables ^D -[RawBlock (Format "latex") "\\listoffigures" -,RawBlock (Format "latex") "\\listoftables"] +[RawBlock (Format "tex") "\\listoffigures" +,RawBlock (Format "tex") "\\listoftables"] ``` diff --git a/test/command/ascii.md b/test/command/ascii.md new file mode 100644 index 000000000..523baa46c --- /dev/null +++ b/test/command/ascii.md @@ -0,0 +1,45 @@ +``` +pandoc -t html --ascii +äéıå +^D +<p>äéıå</p> +``` + +``` +pandoc -t latex --ascii +äéıå +^D +\"{a}\'{e}\i \r{a} +``` + +``` +pandoc -t man --ascii +äéıå +^D +.PP +\[u00E4]\[u00E9]\[u0131]\[u00E5] +``` + +``` +pandoc -t ms --ascii +äéıå +^D +.LP +\[u00E4]\[u00E9]\[u0131]\[u00E5] +``` + +``` +pandoc -t docbook --ascii +äéıå +^D +<para> + äéıå +</para> +``` + +``` +pandoc -t jats --ascii +äéıå +^D +<p>äéıå</p> +``` diff --git a/test/command/bar.tex b/test/command/bar.tex new file mode 100644 index 000000000..e2113ab93 --- /dev/null +++ b/test/command/bar.tex @@ -0,0 +1 @@ +\emph{hi there} diff --git a/test/command/emoji.md b/test/command/emoji.md new file mode 100644 index 000000000..b5c573b3f --- /dev/null +++ b/test/command/emoji.md @@ -0,0 +1,27 @@ +``` +% pandoc -t markdown+emoji -f markdown+emoji +:smile: +^D +:smile: +``` + +``` +% pandoc -t markdown-emoji -f markdown+emoji +:smile: +^D +😄 +``` + +``` +% pandoc -t gfm -f markdown+emoji +:smile: +^D +:smile: +``` + +``` +% pandoc -t gfm-emoji -f markdown+emoji +:smile: +^D +😄 +``` diff --git a/test/command/empty-inline-code.txt b/test/command/empty-inline-code.txt new file mode 100644 index 000000000..b57072a44 --- /dev/null +++ b/test/command/empty-inline-code.txt @@ -0,0 +1,6 @@ +``` +% pandoc -t native +` ` +^D +[Code ("",[],[]) ""] +``` diff --git a/test/command/gfm.md b/test/command/gfm.md index 670f3cd6e..7a7098989 100644 --- a/test/command/gfm.md +++ b/test/command/gfm.md @@ -38,7 +38,7 @@ gfm tests: % pandoc -f gfm -t native My:thumbsup:emoji:heart: ^D -[Para [Str "My\128077emoji\10084\65039"]] +[Para [Str "My",Span ("",["emoji"],[("data-emoji","thumbsup")]) [Str "\128077"],Str "emoji",Span ("",["emoji"],[("data-emoji","heart")]) [Str "\10084\65039"]]] ``` ``` diff --git a/test/command/hspace.md b/test/command/hspace.md index ec1669ca5..a8b97b8bc 100644 --- a/test/command/hspace.md +++ b/test/command/hspace.md @@ -8,7 +8,7 @@ Here they need to be inline: \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}"] +[RawBlock (Format "tex") "\\begin{figure}\n\\includegraphics{lalune.jpg}\n\\caption{lalune \\hspace{2em} \\vspace{1em} bloo}\n\\end{figure}"] ``` Here block: @@ -32,7 +32,7 @@ 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}"] +[RawBlock (Format "tex") "\\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}"] ``` ``` @@ -51,6 +51,6 @@ hi there ^D [Para [Str "hi"] -,RawBlock (Format "latex") "\\hspace{1em}" +,RawBlock (Format "tex") "\\hspace{1em}" ,Para [Str "there"]] ``` diff --git a/test/command/macros.md b/test/command/macros.md index 9de87e7a0..d091c2191 100644 --- a/test/command/macros.md +++ b/test/command/macros.md @@ -24,18 +24,18 @@ expanded at point of use: % pandoc -f latex -t latex \let\a\b \newcommand{\b}{\emph{ouk}} -\a +\a a ^D -\b +a̱ ``` ``` % pandoc -f latex -t latex \newcommand{\a}{\b} \newcommand{\b}{\emph{ouk}} -\a +\a a ^D -\emph{ouk} +\emph{ouk}a ``` ``` diff --git a/test/command/refs.md b/test/command/refs.md index 66959e5c3..8b58ea6d7 100644 --- a/test/command/refs.md +++ b/test/command/refs.md @@ -42,12 +42,55 @@ Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all 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"]] +[Para [Image ("fig:Logo",[],[]) [Str "Logo",Span ("",[],[("label","fig:Logo")]) []] ("command/SVG_logo.svg","fig:")] +,Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:Logo")]) [Str "1"] ("#fig:Logo",""),Space,Str "illustrated",Space,Str "the",Space,Str "SVG",Space,Str "logo"]] ``` ``` % pandoc -f latex -t native +\chapter{One} +\begin{figure} + \includegraphics{command/SVG_logo.svg} + \caption{Logo} + \label{fig:Logo} +\end{figure} + +\begin{figure} + \includegraphics{command/SVG_logo2.svg} + \caption{Logo2} + \label{fig:Logo2} +\end{figure} + +\chapter{Two} + +\section{Subone} + +\begin{figure} + \includegraphics{command/SVG_logo3.svg} + \caption{Logo3} + \label{fig:Logo3} +\end{figure} + +Figure \ref{fig:Logo} illustrated the SVG logo + +Figure \ref{fig:Logo2} illustrated the SVG logo + +Figure \ref{fig:Logo3} illustrated the SVG logo +^D +[Header 1 ("one",[],[]) [Str "One"] +,Para [Image ("fig:Logo",[],[]) [Str "Logo",Span ("",[],[("label","fig:Logo")]) []] ("command/SVG_logo.svg","fig:")] +,Para [Image ("fig:Logo2",[],[]) [Str "Logo2",Span ("",[],[("label","fig:Logo2")]) []] ("command/SVG_logo2.svg","fig:")] +,Header 1 ("two",[],[]) [Str "Two"] +,Header 2 ("subone",[],[]) [Str "Subone"] +,Para [Image ("fig:Logo3",[],[]) [Str "Logo3",Span ("",[],[("label","fig:Logo3")]) []] ("command/SVG_logo3.svg","fig:")] +,Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:Logo")]) [Str "1.1"] ("#fig:Logo",""),Space,Str "illustrated",Space,Str "the",Space,Str "SVG",Space,Str "logo"] +,Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:Logo2")]) [Str "1.2"] ("#fig:Logo2",""),Space,Str "illustrated",Space,Str "the",Space,Str "SVG",Space,Str "logo"] +,Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:Logo3")]) [Str "2.1"] ("#fig:Logo3",""),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/write18.md b/test/command/write18.md index 344dfc8cf..5000c298b 100644 --- a/test/command/write18.md +++ b/test/command/write18.md @@ -3,7 +3,7 @@ Handle \write18{..} as raw tex: % pandoc -t native \write18{git --version} ^D -[RawBlock (Format "latex") "\\write18{git --version}"] +[RawBlock (Format "tex") "\\write18{git --version}"] ``` ``` diff --git a/test/command/yaml-metadata-blocks.md b/test/command/yaml-metadata-blocks.md new file mode 100644 index 000000000..5b73cff72 --- /dev/null +++ b/test/command/yaml-metadata-blocks.md @@ -0,0 +1,63 @@ +``` +% pandoc -s -t native +--- +foobar_: this should be ignored +foo: + bar_: as should this +--- +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaMap (fromList []))]}) +[] +``` +``` +% pandoc -s -t native +--- +# For precedence, see multiple-metadata-blocks.md and vars-and-metadata.md +# For Bools, see also 4819.md +# For Multiline strings, see yaml-with-chomp.md +int: 7 +float: 1.5 +scientific: 3.7e-5 +bool: true +more: False +nothing: null +emtpy: [] +nested: + int: 8 + float: 2.5 + bool: true + more: False + nothing: null + emtpy: [] + scientific: 3.7e-5 +--- +^D +Pandoc (Meta {unMeta = fromList [("bool",MetaBool True),("emtpy",MetaList []),("float",MetaInlines [Str "1.5"]),("int",MetaInlines [Str "7"]),("more",MetaBool False),("nested",MetaMap (fromList [("bool",MetaBool True),("emtpy",MetaList []),("float",MetaInlines [Str "2.5"]),("int",MetaInlines [Str "8"]),("more",MetaBool False),("nothing",MetaInlines [Str "null"]),("scientific",MetaInlines [Str "3.7e-5"])])),("nothing",MetaInlines [Str "null"]),("scientific",MetaInlines [Str "3.7e-5"])]}) +[] +``` +``` +% pandoc -s -t native +--- +array: + - foo: bar + - bool: True +--- +^D +Pandoc (Meta {unMeta = fromList [("array",MetaList [MetaMap (fromList [("foo",MetaInlines [Str "bar"])]),MetaMap (fromList [("bool",MetaBool True)])])]}) +[] +``` +``` +% pandoc -s -t native --metadata-file command/yaml-metadata.yaml +--- +title: document +--- +^D +Pandoc (Meta {unMeta = fromList [("other",MetaInlines [Emph [Str "markdown"],Space,Str "value"]),("title",MetaInlines [Str "document"])]}) +[] +``` +``` +% pandoc -s -t native --metadata-file command/yaml-metadata.yaml -M title=cmdline +^D +Pandoc (Meta {unMeta = fromList [("other",MetaInlines [Emph [Str "markdown"],Space,Str "value"]),("title",MetaString "cmdline")]}) +[] +``` diff --git a/test/command/yaml-metadata.yaml b/test/command/yaml-metadata.yaml new file mode 100644 index 000000000..9cd0043d3 --- /dev/null +++ b/test/command/yaml-metadata.yaml @@ -0,0 +1,4 @@ +--- +title: file +other: _markdown_ value +--- |