aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/LaTeX.hs23
-rw-r--r--test/Tests/Readers/Muse.hs64
-rw-r--r--test/Tests/Readers/RST.hs13
-rw-r--r--test/command/2549.md38
-rw-r--r--test/command/3771.md14
-rw-r--r--test/command/3880.md6
-rw-r--r--test/command/3880.txt1
7 files changed, 154 insertions, 5 deletions
diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs
index b07eb875a..4effe26e8 100644
--- a/test/Tests/Readers/LaTeX.hs
+++ b/test/Tests/Readers/LaTeX.hs
@@ -143,6 +143,29 @@ tests = [ testGroup "basic"
"hello\\pfbreak*{}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
]
+ , testGroup "biblatex roman numerals"
+ [ "upper" =:
+ "number \\RN{12}" =?>
+ para (str "number" <> space <> str "XII")
+ , "lower" =:
+ "number \\Rn{29}" =?>
+ para (str "number" <> space <> str "xxix")
+ , "leading zero" =:
+ "\\Rn{014}" =?>
+ para (str "xiv")
+ , "surrounding spaces" =:
+ "number \\Rn{ 41 }" =?>
+ para (str "number" <> space <> str "xli")
+ , "zero" =:
+ "\\RN{0}" =?>
+ para (str "")
+ , "space then unbraced argument" =:
+ "\\RN 7 ok" =?>
+ para (str "VII" <> space <> str "ok")
+ , "space before braced argument" =:
+ "\\Rn {13}ok" =?>
+ para (str "xiiiok")
+ ]
]
baseCitation :: Citation
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 8d4ad0b15..dac167a92 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -145,8 +145,61 @@ tests =
, " with a continuation"
] =?>
blockQuote (para "This is a quotation with a continuation")
+ , testGroup "Div"
+ [ "Div without id" =:
+ "<div>Foo bar</div>" =?>
+ divWith nullAttr (para "Foo bar")
+ , "Div with id" =:
+ "<div id=\"foo\">Foo bar</div>" =?>
+ divWith ("foo", [], []) (para "Foo bar")
+ ]
+ , "Verse" =:
+ T.unlines [ "> This is"
+ , "> First stanza"
+ , ">" -- Emacs produces verbatim ">" here, we follow Amusewiki
+ , "> And this is"
+ , "> Second stanza"
+ , ">"
+ , ""
+ , ">"
+ , ""
+ , "> Another verse"
+ , "> is here"
+ ] =?>
+ lineBlock [ "This is"
+ , "First stanza"
+ , ""
+ , "And this is"
+ , "\160\160Second stanza"
+ , ""
+ ] <>
+ lineBlock [ "" ] <>
+ lineBlock [ "Another verse"
+ , "\160\160\160is here"
+ ]
]
, "Quote tag" =: "<quote>Hello, world</quote>" =?> blockQuote (para $ text "Hello, world")
+ , "Verse tag" =:
+ T.unlines [ "<verse>"
+ , ""
+ , "Foo bar baz"
+ , " One two three"
+ , ""
+ , "</verse>"
+ , "<verse>Foo bar</verse>"
+ , "<verse>"
+ , "Foo bar</verse>"
+ , "<verse>"
+ , " Foo</verse>"
+ ] =?>
+ lineBlock [ ""
+ , text "Foo bar baz"
+ , text "\160\160One two three"
+ , ""
+ ] <>
+ lineBlock [ "Foo bar" ] <>
+ lineBlock [ "Foo bar" ] <>
+ lineBlock [ "\160\160\160Foo" ]
, "Center" =: "<center>Hello, world</center>" =?> para (text "Hello, world")
, "Right" =: "<right>Hello, world</right>" =?> para (text "Hello, world")
, testGroup "Comments"
@@ -157,20 +210,21 @@ tests =
]
, testGroup "Headers"
[ "Part" =:
- "* First level\n" =?>
+ "* First level" =?>
header 1 "First level"
, "Chapter" =:
- "** Second level\n" =?>
+ "** Second level" =?>
header 2 "Second level"
, "Section" =:
- "*** Third level\n" =?>
+ "*** Third level" =?>
header 3 "Third level"
, "Subsection" =:
- "**** Fourth level\n" =?>
+ "**** Fourth level" =?>
header 4 "Fourth level"
, "Subsubsection" =:
- "***** Fifth level\n" =?>
+ "***** Fifth level" =?>
header 5 "Fifth level"
+ , "Whitespace is required after *" =: "**Not a header" =?> para "**Not a header"
, "No headers in footnotes" =:
T.unlines [ "Foo[1]"
, "[1] * Bar"
diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs
index 61a2673f5..928fc1a99 100644
--- a/test/Tests/Readers/RST.hs
+++ b/test/Tests/Readers/RST.hs
@@ -136,6 +136,19 @@ tests = [ "line block with blank line" =:
para "but must stop here")
, "line block with 3 lines" =: "| a\n| b\n| c"
=?> lineBlock ["a", "b", "c"]
+ , "line blocks with blank lines" =: T.unlines
+ [ "|"
+ , ""
+ , "|"
+ , "| a"
+ , "| b"
+ , "|"
+ , ""
+ , "|"
+ ] =?>
+ lineBlock [""] <>
+ lineBlock ["", "a", "b", ""] <>
+ lineBlock [""]
, "quoted literal block using >" =: "::\n\n> quoted\n> block\n\nOrdinary paragraph"
=?> codeBlock "> quoted\n> block" <> para "Ordinary paragraph"
, "quoted literal block using | (not a line block)" =: "::\n\n| quoted\n| block\n\nOrdinary paragraph"
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/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/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