diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Old.hs | 5 | ||||
-rw-r--r-- | tests/Tests/Readers/Docx.hs | 18 | ||||
-rw-r--r-- | tests/Tests/Readers/HTML.hs | 5 | ||||
-rw-r--r-- | tests/Tests/Readers/Org.hs | 56 | ||||
-rw-r--r-- | tests/docx/enumerated_headings.docx | bin | 0 -> 12539 bytes | |||
-rw-r--r-- | tests/docx/enumerated_headings.native | 4 | ||||
-rw-r--r-- | tests/docx/track_changes_move.docx | bin | 0 -> 26151 bytes | |||
-rw-r--r-- | tests/docx/track_changes_move_accept.native | 3 | ||||
-rw-r--r-- | tests/docx/track_changes_move_all.native | 4 | ||||
-rw-r--r-- | tests/docx/track_changes_move_reject.native | 3 | ||||
-rw-r--r-- | tests/markdown-reader-more.native | 4 | ||||
-rw-r--r-- | tests/mediawiki-reader.native | 5 | ||||
-rw-r--r-- | tests/mediawiki-reader.wiki | 8 | ||||
-rw-r--r-- | tests/pipe-tables.native | 16 | ||||
-rw-r--r-- | tests/pipe-tables.txt | 8 | ||||
-rw-r--r-- | tests/tables.docbook5 | 432 | ||||
-rw-r--r-- | tests/tables.latex | 90 | ||||
-rw-r--r-- | tests/writer.docbook5 | 1395 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 2 | ||||
-rw-r--r-- | tests/writers-lang-and-dir.latex | 8 |
20 files changed, 2005 insertions, 61 deletions
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs index 36bb3398e..4e0eb46a4 100644 --- a/tests/Tests/Old.hs +++ b/tests/Tests/Old.hs @@ -57,7 +57,7 @@ tests = [ testGroup "markdown" "tables.txt" "tables.native" , test "pipe tables" ["-r", "markdown", "-w", "native", "--columns=80"] "pipe-tables.txt" "pipe-tables.native" - , test "more" ["-r", "markdown", "-w", "native", "-S"] + , test "more" ["-r", "markdown", "-w", "native", "-s", "-S"] "markdown-reader-more.txt" "markdown-reader-more.native" , lhsReaderTest "markdown+lhs" ] @@ -108,6 +108,9 @@ tests = [ testGroup "markdown" , test "reader" ["-r", "docbook", "-w", "native", "-s"] "docbook-xref.docbook" "docbook-xref.native" ] + , testGroup "docbook5" + [ testGroup "writer" $ writerTests "docbook5" + ] , testGroup "native" [ testGroup "writer" $ writerTests "native" , test "reader" ["-r", "native", "-w", "native", "-s"] diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index 9284d165a..aeb6bf939 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -169,10 +169,14 @@ tests = [ testGroup "inlines" "docx/already_auto_ident.docx" "docx/already_auto_ident.native" , testCompare - "numbered headers automatically made into list" + "single numbered item not made into list" "docx/numbered_header.docx" "docx/numbered_header.native" , testCompare + "enumerated headers not made into numbered list" + "docx/enumerated_headings.docx" + "docx/enumerated_headings.native" + , testCompare "i18n blocks (headers and blockquotes)" "docx/i18n_blocks.docx" "docx/i18n_blocks.native" @@ -262,6 +266,18 @@ tests = [ testGroup "inlines" "keep deletion (all)" "docx/track_changes_deletion.docx" "docx/track_changes_deletion_all.native" + , testCompareWithOpts def{readerTrackChanges=AcceptChanges} + "move text (accept)" + "docx/track_changes_move.docx" + "docx/track_changes_move_accept.native" + , testCompareWithOpts def{readerTrackChanges=RejectChanges} + "move text (reject)" + "docx/track_changes_move.docx" + "docx/track_changes_move_reject.native" + , testCompareWithOpts def{readerTrackChanges=AllChanges} + "move text (all)" + "docx/track_changes_move.docx" + "docx/track_changes_move_all.native" ] , testGroup "media" [ testMediaBag diff --git a/tests/Tests/Readers/HTML.hs b/tests/Tests/Readers/HTML.hs index 2eb87a2f3..ff27b8aed 100644 --- a/tests/Tests/Readers/HTML.hs +++ b/tests/Tests/Readers/HTML.hs @@ -15,11 +15,14 @@ html = handleError . readHtml def tests :: [Test] tests = [ testGroup "base tag" [ test html "simple" $ - "<head><base href=\"http://www.w3schools.com/images\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?> + "<head><base href=\"http://www.w3schools.com/images/foo\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman")) , test html "slash at end of base" $ "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman")) + , test html "slash at beginning of href" $ + "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"/stickman.gif\" alt=\"Stickman\"></head>" =?> + plain (image "http://www.w3schools.com/stickman.gif" "" (text "Stickman")) , test html "absolute URL" $ "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"http://example.com/stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://example.com/stickman.gif" "" (text "Stickman")) diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index b095ac60a..17682fb32 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -308,6 +308,10 @@ tests = "\\textit{Emphasised}" =?> para (emph "Emphasised") + , "Inline LaTeX command with spaces" =: + "\\emph{Emphasis mine}" =?> + para (emph "Emphasis mine") + , "Inline LaTeX math symbol" =: "\\tau" =?> para (emph "τ") @@ -328,6 +332,10 @@ tests = "\\copy" =?> para "©" + , "MathML symbols, space separated" =: + "\\ForAll \\Auml" =?> + para "∀ Ä" + , "LaTeX citation" =: "\\cite{Coffee}" =?> let citation = Citation @@ -941,7 +949,7 @@ tests = , "Empty table" =: "||" =?> - simpleTable' 1 mempty mempty + simpleTable' 1 mempty [[mempty]] , "Glider Table" =: unlines [ "| 1 | 0 | 0 |" @@ -996,6 +1004,17 @@ tests = , [ plain "dynamic", plain "Lisp" ] ] + , "Table with empty cells" =: + "|||c|" =?> + simpleTable' 3 mempty [[mempty, mempty, plain "c"]] + + , "Table with empty rows" =: + unlines [ "| first |" + , "| |" + , "| third |" + ] =?> + simpleTable' 1 mempty [[plain "first"], [mempty], [plain "third"]] + , "Table with alignment row" =: unlines [ "| Numbers | Text | More |" , "| <c> | <r> | |" @@ -1024,10 +1043,10 @@ tests = , "| 1 | One | foo |" , "| 2" ] =?> - table "" (zip [AlignCenter, AlignRight, AlignDefault] [0, 0, 0]) - [ plain "Numbers", plain "Text" , plain mempty ] - [ [ plain "1" , plain "One" , plain "foo" ] - , [ plain "2" , plain mempty , plain mempty ] + table "" (zip [AlignCenter, AlignRight] [0, 0]) + [ plain "Numbers", plain "Text" ] + [ [ plain "1" , plain "One" , plain "foo" ] + , [ plain "2" ] ] , "Table with caption" =: @@ -1054,6 +1073,33 @@ tests = " where greeting = \"moin\"\n" in codeBlockWith attr' code' + , "Source block with indented code" =: + unlines [ " #+BEGIN_SRC haskell" + , " main = putStrLn greeting" + , " where greeting = \"moin\"" + , " #+END_SRC" ] =?> + let attr' = ("", ["haskell"], []) + code' = "main = putStrLn greeting\n" ++ + " where greeting = \"moin\"\n" + in codeBlockWith attr' code' + + , "Source block with tab-indented code" =: + unlines [ "\t#+BEGIN_SRC haskell" + , "\tmain = putStrLn greeting" + , "\t where greeting = \"moin\"" + , "\t#+END_SRC" ] =?> + let attr' = ("", ["haskell"], []) + code' = "main = putStrLn greeting\n" ++ + " where greeting = \"moin\"\n" + in codeBlockWith attr' code' + + , "Empty source block" =: + unlines [ " #+BEGIN_SRC haskell" + , " #+END_SRC" ] =?> + let attr' = ("", ["haskell"], []) + code' = "" + in codeBlockWith attr' code' + , "Source block between paragraphs" =: unlines [ "Low German greeting" , " #+BEGIN_SRC haskell" diff --git a/tests/docx/enumerated_headings.docx b/tests/docx/enumerated_headings.docx Binary files differnew file mode 100644 index 000000000..afa84748a --- /dev/null +++ b/tests/docx/enumerated_headings.docx diff --git a/tests/docx/enumerated_headings.native b/tests/docx/enumerated_headings.native new file mode 100644 index 000000000..67c0df5e0 --- /dev/null +++ b/tests/docx/enumerated_headings.native @@ -0,0 +1,4 @@ +[Header 1 ("h1",[],[]) [Str "H1"] +,Header 2 ("h2",[],[]) [Str "H2"] +,Header 3 ("h3",[],[]) [Str "H3"] +,Para [Str "And",Space,Str "some",Space,Str "text"]] diff --git a/tests/docx/track_changes_move.docx b/tests/docx/track_changes_move.docx Binary files differnew file mode 100644 index 000000000..b70779fd4 --- /dev/null +++ b/tests/docx/track_changes_move.docx diff --git a/tests/docx/track_changes_move_accept.native b/tests/docx/track_changes_move_accept.native new file mode 100644 index 000000000..0cf276768 --- /dev/null +++ b/tests/docx/track_changes_move_accept.native @@ -0,0 +1,3 @@ +[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text."] +,Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "text",Space,Str "to",Space,Str "be",Space,Str "moved."] +,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "more",Space,Str "text."]] diff --git a/tests/docx/track_changes_move_all.native b/tests/docx/track_changes_move_all.native new file mode 100644 index 000000000..3afae83a5 --- /dev/null +++ b/tests/docx/track_changes_move_all.native @@ -0,0 +1,4 @@ +[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text."] +,Para [Span ("",["insertion"],[("author","Jesse Rosenthal"),("date","2016-04-16T08:20:00Z")]) [Str "Here",Space,Str "is",Space,Str "the",Space,Str "text",Space,Str "to",Space,Str "be",Space,Str "moved."]] +,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "more",Space,Str "text."] +,Para [Span ("",["deletion"],[("author","Jesse Rosenthal"),("date","2016-04-16T08:20:00Z")]) [Str "Here",Space,Str "is",Space,Str "the",Space,Str "text",Space,Str "to",Space,Str "be",Space,Str "moved."]]] diff --git a/tests/docx/track_changes_move_reject.native b/tests/docx/track_changes_move_reject.native new file mode 100644 index 000000000..9c57871b6 --- /dev/null +++ b/tests/docx/track_changes_move_reject.native @@ -0,0 +1,3 @@ +[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text."] +,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "more",Space,Str "text."] +,Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "text",Space,Str "to",Space,Str "be",Space,Str "moved."]] diff --git a/tests/markdown-reader-more.native b/tests/markdown-reader-more.native index 0148e9394..c38ffe038 100644 --- a/tests/markdown-reader-more.native +++ b/tests/markdown-reader-more.native @@ -1,5 +1,5 @@ -[Para [Str "spanning",Space,Str "multiple",Space,Str "lines",SoftBreak,Str "%",Space,Str "Author",Space,Str "One",SoftBreak,Str "Author",Space,Str "Two;",Space,Str "Author",Space,Str "Three;",SoftBreak,Str "Author",Space,Str "Four"] -,Header 1 ("additional-markdown-reader-tests",[],[]) [Str "Additional",Space,Str "markdown",Space,Str "reader",Space,Str "tests"] +Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Author",Space,Str "One"],MetaInlines [Str "Author",Space,Str "Two"],MetaInlines [Str "Author",Space,Str "Three"],MetaInlines [Str "Author",Space,Str "Four"]]),("title",MetaInlines [Str "Title",SoftBreak,Str "spanning",Space,Str "multiple",Space,Str "lines"])]}) +[Header 1 ("additional-markdown-reader-tests",[],[]) [Str "Additional",Space,Str "markdown",Space,Str "reader",Space,Str "tests"] ,Header 2 ("blank-line-before-url-in-link-reference",[],[]) [Str "Blank",Space,Str "line",Space,Str "before",Space,Str "URL",Space,Str "in",Space,Str "link",Space,Str "reference"] ,Para [Link ("",[],[]) [Str "foo"] ("/url",""),Space,Str "and",Space,Link ("",[],[]) [Str "bar"] ("/url","title")] ,Header 2 ("raw-context-environments",[],[]) [Str "Raw",Space,Str "ConTeXt",Space,Str "environments"] diff --git a/tests/mediawiki-reader.native b/tests/mediawiki-reader.native index cf80d0664..6afeb602c 100644 --- a/tests/mediawiki-reader.native +++ b/tests/mediawiki-reader.native @@ -252,6 +252,11 @@ Pandoc (Meta {unMeta = fromList []}) [[]] [[[Para [Str "Orange"]]]] ,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."] +,Table [] [AlignDefault,AlignDefault] [0.0,0.0] + [[Para [Str "fruit"]] + ,[Para [Str "topping"]]] + [[[Para [Str "apple"]] + ,[Para [Str "ice",Space,Str "cream"]]]] ,Header 2 ("notes",[],[]) [Str "notes"] ,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]] ,Para [Str "URL",Space,Str "note.",Note [Plain [Link ("",[],[]) [Str "http://docs.python.org/library/functions.html#range"] ("http://docs.python.org/library/functions.html#range","")]]]] diff --git a/tests/mediawiki-reader.wiki b/tests/mediawiki-reader.wiki index 862bb3b48..11cd52d9c 100644 --- a/tests/mediawiki-reader.wiki +++ b/tests/mediawiki-reader.wiki @@ -381,6 +381,14 @@ and cheese |Orange |}Paragraph after the table. +{| + !fruit + !topping + |- + |apple + |ice cream + |} + == notes == My note!<ref>This.</ref> diff --git a/tests/pipe-tables.native b/tests/pipe-tables.native index 6cd37f6ff..63c2c17bc 100644 --- a/tests/pipe-tables.native +++ b/tests/pipe-tables.native @@ -98,4 +98,18 @@ ,Para [Str "Pipe",Space,Str "table",Space,Str "with",Space,Str "no",Space,Str "body:"] ,Table [] [AlignDefault] [0.0] [[Plain [Str "Header"]]] - []] + [] +,Para [Str "Pipe",Space,Str "table",Space,Str "with",Space,Str "tricky",Space,Str "cell",Space,Str "contents",Space,Str "(see",Space,Str "#2765):"] +,Table [] [AlignLeft,AlignRight,AlignRight] [0.0,0.0,0.0] + [[] + ,[Plain [Str "IP_gene8-_1st"]] + ,[Plain [Str "IP_gene8+_1st"]]] + [[[Plain [Str "IP_gene8-_1st"]] + ,[Plain [Str "1.0000000"]] + ,[Plain [Str "0.4357325"]]] + ,[[Plain [Str "IP_gene8+_1st"]] + ,[Plain [Str "0.4357325"]] + ,[Plain [Str "1.0000000"]]] + ,[[Plain [Str "foo",Code ("",[],[]) "bar|baz"]] + ,[Plain [Str "and|escaped"]] + ,[Plain [Str "3.0000000"]]]]] diff --git a/tests/pipe-tables.txt b/tests/pipe-tables.txt index e93f64af9..c27c71113 100644 --- a/tests/pipe-tables.txt +++ b/tests/pipe-tables.txt @@ -72,3 +72,11 @@ Pipe table with no body: | Header | | ------ | +Pipe table with tricky cell contents (see #2765): + +| | IP_gene8-_1st| IP_gene8+_1st| +|:--------------|-------------:|-------------:| +|IP_gene8-_1st | 1.0000000| 0.4357325| +|IP_gene8+_1st | 0.4357325| 1.0000000| +|foo`bar|baz` | and\|escaped | 3.0000000| + diff --git a/tests/tables.docbook5 b/tests/tables.docbook5 new file mode 100644 index 000000000..6224cf222 --- /dev/null +++ b/tests/tables.docbook5 @@ -0,0 +1,432 @@ +<para> + Simple table with caption: +</para> +<table> + <title> + Demonstration of simple table syntax. + </title> + <tgroup cols="4"> + <colspec align="right" /> + <colspec align="left" /> + <colspec align="center" /> + <colspec align="left" /> + <thead> + <row> + <entry> + Right + </entry> + <entry> + Left + </entry> + <entry> + Center + </entry> + <entry> + Default + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + </row> + <row> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + </row> + <row> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + </row> + </tbody> + </tgroup> +</table> +<para> + Simple table without caption: +</para> +<informaltable> + <tgroup cols="4"> + <colspec align="right" /> + <colspec align="left" /> + <colspec align="center" /> + <colspec align="left" /> + <thead> + <row> + <entry> + Right + </entry> + <entry> + Left + </entry> + <entry> + Center + </entry> + <entry> + Default + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + </row> + <row> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + </row> + <row> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + </row> + </tbody> + </tgroup> +</informaltable> +<para> + Simple table indented two spaces: +</para> +<table> + <title> + Demonstration of simple table syntax. + </title> + <tgroup cols="4"> + <colspec align="right" /> + <colspec align="left" /> + <colspec align="center" /> + <colspec align="left" /> + <thead> + <row> + <entry> + Right + </entry> + <entry> + Left + </entry> + <entry> + Center + </entry> + <entry> + Default + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + </row> + <row> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + </row> + <row> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + </row> + </tbody> + </tgroup> +</table> +<para> + Multiline table with caption: +</para> +<table> + <title> + Here's the caption. It may span multiple lines. + </title> + <tgroup cols="4"> + <colspec colwidth="15*" align="center" /> + <colspec colwidth="13*" align="left" /> + <colspec colwidth="16*" align="right" /> + <colspec colwidth="33*" align="left" /> + <thead> + <row> + <entry> + Centered Header + </entry> + <entry> + Left Aligned + </entry> + <entry> + Right Aligned + </entry> + <entry> + Default aligned + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + First + </entry> + <entry> + row + </entry> + <entry> + 12.0 + </entry> + <entry> + Example of a row that spans multiple lines. + </entry> + </row> + <row> + <entry> + Second + </entry> + <entry> + row + </entry> + <entry> + 5.0 + </entry> + <entry> + Here's another one. Note the blank line between rows. + </entry> + </row> + </tbody> + </tgroup> +</table> +<para> + Multiline table without caption: +</para> +<informaltable> + <tgroup cols="4"> + <colspec colwidth="15*" align="center" /> + <colspec colwidth="13*" align="left" /> + <colspec colwidth="16*" align="right" /> + <colspec colwidth="33*" align="left" /> + <thead> + <row> + <entry> + Centered Header + </entry> + <entry> + Left Aligned + </entry> + <entry> + Right Aligned + </entry> + <entry> + Default aligned + </entry> + </row> + </thead> + <tbody> + <row> + <entry> + First + </entry> + <entry> + row + </entry> + <entry> + 12.0 + </entry> + <entry> + Example of a row that spans multiple lines. + </entry> + </row> + <row> + <entry> + Second + </entry> + <entry> + row + </entry> + <entry> + 5.0 + </entry> + <entry> + Here's another one. Note the blank line between rows. + </entry> + </row> + </tbody> + </tgroup> +</informaltable> +<para> + Table without column headers: +</para> +<informaltable> + <tgroup cols="4"> + <colspec align="right" /> + <colspec align="left" /> + <colspec align="center" /> + <colspec align="right" /> + <tbody> + <row> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + <entry> + 12 + </entry> + </row> + <row> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + <entry> + 123 + </entry> + </row> + <row> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + <entry> + 1 + </entry> + </row> + </tbody> + </tgroup> +</informaltable> +<para> + Multiline table without column headers: +</para> +<informaltable> + <tgroup cols="4"> + <colspec colwidth="15*" align="center" /> + <colspec colwidth="13*" align="left" /> + <colspec colwidth="16*" align="right" /> + <colspec colwidth="33*" align="left" /> + <tbody> + <row> + <entry> + First + </entry> + <entry> + row + </entry> + <entry> + 12.0 + </entry> + <entry> + Example of a row that spans multiple lines. + </entry> + </row> + <row> + <entry> + Second + </entry> + <entry> + row + </entry> + <entry> + 5.0 + </entry> + <entry> + Here's another one. Note the blank line between rows. + </entry> + </row> + </tbody> + </tgroup> +</informaltable> diff --git a/tests/tables.latex b/tests/tables.latex index 96cbc9579..9f3f97e53 100644 --- a/tests/tables.latex +++ b/tests/tables.latex @@ -52,47 +52,47 @@ Multiline table with caption: \begin{longtable}[]{@{}clrl@{}} \caption{Here's the caption. It may span multiple lines.}\tabularnewline \toprule -\begin{minipage}[b]{0.13\columnwidth}\centering\strut +\begin{minipage}[b]{0.13\columnwidth}\centering Centered Header -\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright Left Aligned -\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft Right Aligned -\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned -\strut\end{minipage}\tabularnewline +\end{minipage}\tabularnewline \midrule \endfirsthead \toprule -\begin{minipage}[b]{0.13\columnwidth}\centering\strut +\begin{minipage}[b]{0.13\columnwidth}\centering Centered Header -\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright Left Aligned -\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft Right Aligned -\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned -\strut\end{minipage}\tabularnewline +\end{minipage}\tabularnewline \midrule \endhead -\begin{minipage}[t]{0.13\columnwidth}\centering\strut +\begin{minipage}[t]{0.13\columnwidth}\centering First -\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright row -\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft 12.0 -\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. -\strut\end{minipage}\tabularnewline -\begin{minipage}[t]{0.13\columnwidth}\centering\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.13\columnwidth}\centering Second -\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright row -\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft 5.0 -\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. -\strut\end{minipage}\tabularnewline +\end{minipage}\tabularnewline \bottomrule \end{longtable} @@ -100,35 +100,35 @@ Multiline table without caption: \begin{longtable}[]{@{}clrl@{}} \toprule -\begin{minipage}[b]{0.13\columnwidth}\centering\strut +\begin{minipage}[b]{0.13\columnwidth}\centering Centered Header -\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright Left Aligned -\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft Right Aligned -\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned -\strut\end{minipage}\tabularnewline +\end{minipage}\tabularnewline \midrule \endhead -\begin{minipage}[t]{0.13\columnwidth}\centering\strut +\begin{minipage}[t]{0.13\columnwidth}\centering First -\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright row -\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft 12.0 -\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. -\strut\end{minipage}\tabularnewline -\begin{minipage}[t]{0.13\columnwidth}\centering\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.13\columnwidth}\centering Second -\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright row -\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft 5.0 -\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. -\strut\end{minipage}\tabularnewline +\end{minipage}\tabularnewline \bottomrule \end{longtable} @@ -146,23 +146,23 @@ Multiline table without column headers: \begin{longtable}[]{@{}clrl@{}} \toprule -\begin{minipage}[t]{0.13\columnwidth}\centering\strut +\begin{minipage}[t]{0.13\columnwidth}\centering First -\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright row -\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft 12.0 -\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. -\strut\end{minipage}\tabularnewline -\begin{minipage}[t]{0.13\columnwidth}\centering\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.13\columnwidth}\centering Second -\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright row -\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut +\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft 5.0 -\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut +\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. -\strut\end{minipage}\tabularnewline +\end{minipage}\tabularnewline \bottomrule \end{longtable} diff --git a/tests/writer.docbook5 b/tests/writer.docbook5 new file mode 100644 index 000000000..5261a35be --- /dev/null +++ b/tests/writer.docbook5 @@ -0,0 +1,1395 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE article> +<article xmlns="http://docbook.org/ns/docbook" version="5.0"> + <info> + <title>Pandoc Test Suite</title> + <authorgroup> + <author> + <firstname>John</firstname> + <surname>MacFarlane</surname> + </author> + <author> + <firstname></firstname> + <surname>Anonymous</surname> + </author> + </authorgroup> + <date>July 17, 2006</date> + </info> +<para> + This is a set of tests for pandoc. Most of them are adapted from John + Gruber’s markdown test suite. +</para> +<section id="headers"> + <title>Headers</title> + <section id="level-2-with-an-embedded-link"> + <title>Level 2 with an <link xlink:href="/url">embedded + link</link></title> + <section id="level-3-with-emphasis"> + <title>Level 3 with <emphasis>emphasis</emphasis></title> + <section id="level-4"> + <title>Level 4</title> + <section id="level-5"> + <title>Level 5</title> + <para> + </para> + </section> + </section> + </section> + </section> +</section> +<section id="level-1"> + <title>Level 1</title> + <section id="level-2-with-emphasis"> + <title>Level 2 with <emphasis>emphasis</emphasis></title> + <section id="level-3"> + <title>Level 3</title> + <para> + with no blank line + </para> + </section> + </section> + <section id="level-2"> + <title>Level 2</title> + <para> + with no blank line + </para> + </section> +</section> +<section id="paragraphs"> + <title>Paragraphs</title> + <para> + Here’s a regular paragraph. + </para> + <para> + In Markdown 1.0.0 and earlier. Version 8. This line turns into a list + item. Because a hard-wrapped line in the middle of a paragraph looked like + a list item. + </para> + <para> + Here’s one with a bullet. * criminey. + </para> +<literallayout>There should be a hard line break +here.</literallayout> +</section> +<section id="block-quotes"> + <title>Block Quotes</title> + <para> + E-mail style: + </para> + <blockquote> + <para> + This is a block quote. It is pretty short. + </para> + </blockquote> + <blockquote> + <para> + Code in a block quote: + </para> + <programlisting> +sub status { + print "working"; +} +</programlisting> + <para> + A list: + </para> + <orderedlist numeration="arabic" spacing="compact"> + <listitem> + <para> + item one + </para> + </listitem> + <listitem> + <para> + item two + </para> + </listitem> + </orderedlist> + <para> + Nested block quotes: + </para> + <blockquote> + <para> + nested + </para> + </blockquote> + <blockquote> + <para> + nested + </para> + </blockquote> + </blockquote> + <para> + This should not be a block quote: 2 > 1. + </para> + <para> + And a following paragraph. + </para> +</section> +<section id="code-blocks"> + <title>Code Blocks</title> + <para> + Code: + </para> + <programlisting> +---- (should be four hyphens) + +sub status { + print "working"; +} + +this code block is indented by one tab +</programlisting> + <para> + And: + </para> + <programlisting> + this code block is indented by two tabs + +These should not be escaped: \$ \\ \> \[ \{ +</programlisting> +</section> +<section id="lists"> + <title>Lists</title> + <section id="unordered"> + <title>Unordered</title> + <para> + Asterisks tight: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + asterisk 1 + </para> + </listitem> + <listitem> + <para> + asterisk 2 + </para> + </listitem> + <listitem> + <para> + asterisk 3 + </para> + </listitem> + </itemizedlist> + <para> + Asterisks loose: + </para> + <itemizedlist> + <listitem> + <para> + asterisk 1 + </para> + </listitem> + <listitem> + <para> + asterisk 2 + </para> + </listitem> + <listitem> + <para> + asterisk 3 + </para> + </listitem> + </itemizedlist> + <para> + Pluses tight: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + Plus 1 + </para> + </listitem> + <listitem> + <para> + Plus 2 + </para> + </listitem> + <listitem> + <para> + Plus 3 + </para> + </listitem> + </itemizedlist> + <para> + Pluses loose: + </para> + <itemizedlist> + <listitem> + <para> + Plus 1 + </para> + </listitem> + <listitem> + <para> + Plus 2 + </para> + </listitem> + <listitem> + <para> + Plus 3 + </para> + </listitem> + </itemizedlist> + <para> + Minuses tight: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + Minus 1 + </para> + </listitem> + <listitem> + <para> + Minus 2 + </para> + </listitem> + <listitem> + <para> + Minus 3 + </para> + </listitem> + </itemizedlist> + <para> + Minuses loose: + </para> + <itemizedlist> + <listitem> + <para> + Minus 1 + </para> + </listitem> + <listitem> + <para> + Minus 2 + </para> + </listitem> + <listitem> + <para> + Minus 3 + </para> + </listitem> + </itemizedlist> + </section> + <section id="ordered"> + <title>Ordered</title> + <para> + Tight: + </para> + <orderedlist numeration="arabic" spacing="compact"> + <listitem> + <para> + First + </para> + </listitem> + <listitem> + <para> + Second + </para> + </listitem> + <listitem> + <para> + Third + </para> + </listitem> + </orderedlist> + <para> + and: + </para> + <orderedlist numeration="arabic" spacing="compact"> + <listitem> + <para> + One + </para> + </listitem> + <listitem> + <para> + Two + </para> + </listitem> + <listitem> + <para> + Three + </para> + </listitem> + </orderedlist> + <para> + Loose using tabs: + </para> + <orderedlist numeration="arabic"> + <listitem> + <para> + First + </para> + </listitem> + <listitem> + <para> + Second + </para> + </listitem> + <listitem> + <para> + Third + </para> + </listitem> + </orderedlist> + <para> + and using spaces: + </para> + <orderedlist numeration="arabic"> + <listitem> + <para> + One + </para> + </listitem> + <listitem> + <para> + Two + </para> + </listitem> + <listitem> + <para> + Three + </para> + </listitem> + </orderedlist> + <para> + Multiple paragraphs: + </para> + <orderedlist numeration="arabic"> + <listitem> + <para> + Item 1, graf one. + </para> + <para> + Item 1. graf two. The quick brown fox jumped over the lazy dog’s + back. + </para> + </listitem> + <listitem> + <para> + Item 2. + </para> + </listitem> + <listitem> + <para> + Item 3. + </para> + </listitem> + </orderedlist> + </section> + <section id="nested"> + <title>Nested</title> + <itemizedlist spacing="compact"> + <listitem> + <para> + Tab + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + Tab + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + Tab + </para> + </listitem> + </itemizedlist> + </listitem> + </itemizedlist> + </listitem> + </itemizedlist> + <para> + Here’s another: + </para> + <orderedlist numeration="arabic" spacing="compact"> + <listitem> + <para> + First + </para> + </listitem> + <listitem> + <para> + Second: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + Fee + </para> + </listitem> + <listitem> + <para> + Fie + </para> + </listitem> + <listitem> + <para> + Foe + </para> + </listitem> + </itemizedlist> + </listitem> + <listitem> + <para> + Third + </para> + </listitem> + </orderedlist> + <para> + Same thing but with paragraphs: + </para> + <orderedlist numeration="arabic"> + <listitem> + <para> + First + </para> + </listitem> + <listitem> + <para> + Second: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + Fee + </para> + </listitem> + <listitem> + <para> + Fie + </para> + </listitem> + <listitem> + <para> + Foe + </para> + </listitem> + </itemizedlist> + </listitem> + <listitem> + <para> + Third + </para> + </listitem> + </orderedlist> + </section> + <section id="tabs-and-spaces"> + <title>Tabs and spaces</title> + <itemizedlist> + <listitem> + <para> + this is a list item indented with tabs + </para> + </listitem> + <listitem> + <para> + this is a list item indented with spaces + </para> + <itemizedlist> + <listitem> + <para> + this is an example list item indented with tabs + </para> + </listitem> + <listitem> + <para> + this is an example list item indented with spaces + </para> + </listitem> + </itemizedlist> + </listitem> + </itemizedlist> + </section> + <section id="fancy-list-markers"> + <title>Fancy list markers</title> + <orderedlist numeration="arabic"> + <listitem override="2"> + <para> + begins with 2 + </para> + </listitem> + <listitem> + <para> + and now 3 + </para> + <para> + with a continuation + </para> + <orderedlist numeration="lowerroman" spacing="compact"> + <listitem override="4"> + <para> + sublist with roman numerals, starting with 4 + </para> + </listitem> + <listitem> + <para> + more items + </para> + <orderedlist numeration="upperalpha" spacing="compact"> + <listitem> + <para> + a subsublist + </para> + </listitem> + <listitem> + <para> + a subsublist + </para> + </listitem> + </orderedlist> + </listitem> + </orderedlist> + </listitem> + </orderedlist> + <para> + Nesting: + </para> + <orderedlist numeration="upperalpha" spacing="compact"> + <listitem> + <para> + Upper Alpha + </para> + <orderedlist numeration="upperroman" spacing="compact"> + <listitem> + <para> + Upper Roman. + </para> + <orderedlist numeration="arabic" spacing="compact"> + <listitem override="6"> + <para> + Decimal start with 6 + </para> + <orderedlist numeration="loweralpha" spacing="compact"> + <listitem override="3"> + <para> + Lower alpha with paren + </para> + </listitem> + </orderedlist> + </listitem> + </orderedlist> + </listitem> + </orderedlist> + </listitem> + </orderedlist> + <para> + Autonumbering: + </para> + <orderedlist spacing="compact"> + <listitem> + <para> + Autonumber. + </para> + </listitem> + <listitem> + <para> + More. + </para> + <orderedlist spacing="compact"> + <listitem> + <para> + Nested. + </para> + </listitem> + </orderedlist> + </listitem> + </orderedlist> + <para> + Should not be a list item: + </para> + <para> + M.A. 2007 + </para> + <para> + B. Williams + </para> + </section> +</section> +<section id="definition-lists"> + <title>Definition Lists</title> + <para> + Tight using spaces: + </para> + <variablelist spacing="compact"> + <varlistentry> + <term> + apple + </term> + <listitem> + <para> + red fruit + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + orange + </term> + <listitem> + <para> + orange fruit + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + banana + </term> + <listitem> + <para> + yellow fruit + </para> + </listitem> + </varlistentry> + </variablelist> + <para> + Tight using tabs: + </para> + <variablelist spacing="compact"> + <varlistentry> + <term> + apple + </term> + <listitem> + <para> + red fruit + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + orange + </term> + <listitem> + <para> + orange fruit + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + banana + </term> + <listitem> + <para> + yellow fruit + </para> + </listitem> + </varlistentry> + </variablelist> + <para> + Loose: + </para> + <variablelist> + <varlistentry> + <term> + apple + </term> + <listitem> + <para> + red fruit + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + orange + </term> + <listitem> + <para> + orange fruit + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + banana + </term> + <listitem> + <para> + yellow fruit + </para> + </listitem> + </varlistentry> + </variablelist> + <para> + Multiple blocks with italics: + </para> + <variablelist> + <varlistentry> + <term> + <emphasis>apple</emphasis> + </term> + <listitem> + <para> + red fruit + </para> + <para> + contains seeds, crisp, pleasant to taste + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <emphasis>orange</emphasis> + </term> + <listitem> + <para> + orange fruit + </para> + <programlisting> +{ orange code block } +</programlisting> + <blockquote> + <para> + orange block quote + </para> + </blockquote> + </listitem> + </varlistentry> + </variablelist> + <para> + Multiple definitions, tight: + </para> + <variablelist spacing="compact"> + <varlistentry> + <term> + apple + </term> + <listitem> + <para> + red fruit + </para> + <para> + computer + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + orange + </term> + <listitem> + <para> + orange fruit + </para> + <para> + bank + </para> + </listitem> + </varlistentry> + </variablelist> + <para> + Multiple definitions, loose: + </para> + <variablelist> + <varlistentry> + <term> + apple + </term> + <listitem> + <para> + red fruit + </para> + <para> + computer + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + orange + </term> + <listitem> + <para> + orange fruit + </para> + <para> + bank + </para> + </listitem> + </varlistentry> + </variablelist> + <para> + Blank line after term, indented marker, alternate markers: + </para> + <variablelist> + <varlistentry> + <term> + apple + </term> + <listitem> + <para> + red fruit + </para> + <para> + computer + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + orange + </term> + <listitem> + <para> + orange fruit + </para> + <orderedlist numeration="arabic" spacing="compact"> + <listitem> + <para> + sublist + </para> + </listitem> + <listitem> + <para> + sublist + </para> + </listitem> + </orderedlist> + </listitem> + </varlistentry> + </variablelist> +</section> +<section id="html-blocks"> + <title>HTML Blocks</title> + <para> + Simple block on one line: + </para> + <para> + foo + </para> + <para> + And nested without indentation: + </para> + <para> + foo + </para> + <para> + bar + </para> + <para> + Interpreted markdown in a table: + </para> + This is <emphasis>emphasized</emphasis> + And this is <emphasis role="strong">strong</emphasis> + <para> + Here’s a simple block: + </para> + <para> + foo + </para> + <para> + This should be a code block, though: + </para> + <programlisting> +<div> + foo +</div> +</programlisting> + <para> + As should this: + </para> + <programlisting> +<div>foo</div> +</programlisting> + <para> + Now, nested: + </para> + <para> + foo + </para> + <para> + This should just be an HTML comment: + </para> + <para> + Multiline: + </para> + <para> + Code block: + </para> + <programlisting> +<!-- Comment --> +</programlisting> + <para> + Just plain comment, with trailing spaces on the line: + </para> + <para> + Code: + </para> + <programlisting> +<hr /> +</programlisting> + <para> + Hr’s: + </para> +</section> +<section id="inline-markup"> + <title>Inline Markup</title> + <para> + This is <emphasis>emphasized</emphasis>, and so <emphasis>is + this</emphasis>. + </para> + <para> + This is <emphasis role="strong">strong</emphasis>, and so + <emphasis role="strong">is this</emphasis>. + </para> + <para> + An <emphasis><link xlink:href="/url">emphasized link</link></emphasis>. + </para> + <para> + <emphasis role="strong"><emphasis>This is strong and + em.</emphasis></emphasis> + </para> + <para> + So is <emphasis role="strong"><emphasis>this</emphasis></emphasis> word. + </para> + <para> + <emphasis role="strong"><emphasis>This is strong and + em.</emphasis></emphasis> + </para> + <para> + So is <emphasis role="strong"><emphasis>this</emphasis></emphasis> word. + </para> + <para> + This is code: <literal>></literal>, <literal>$</literal>, + <literal>\</literal>, <literal>\$</literal>, + <literal><html></literal>. + </para> + <para> + <emphasis role="strikethrough">This is + <emphasis>strikeout</emphasis>.</emphasis> + </para> + <para> + Superscripts: a<superscript>bc</superscript>d + a<superscript><emphasis>hello</emphasis></superscript> + a<superscript>hello there</superscript>. + </para> + <para> + Subscripts: H<subscript>2</subscript>O, H<subscript>23</subscript>O, + H<subscript>many of them</subscript>O. + </para> + <para> + These should not be superscripts or subscripts, because of the unescaped + spaces: a^b c^d, a~b c~d. + </para> +</section> +<section id="smart-quotes-ellipses-dashes"> + <title>Smart quotes, ellipses, dashes</title> + <para> + <quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my + name.</quote> + </para> + <para> + <quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are letters. + </para> + <para> + <quote>Oak,</quote> <quote>elm,</quote> and <quote>beech</quote> are names + of trees. So is <quote>pine.</quote> + </para> + <para> + <quote>He said, <quote>I want to go.</quote></quote> Were you alive in the + 70’s? + </para> + <para> + Here is some quoted <quote><literal>code</literal></quote> and a + <quote><link xlink:href="http://example.com/?foo=1&bar=2">quoted + link</link></quote>. + </para> + <para> + Some dashes: one—two — three—four — five. + </para> + <para> + Dashes between numbers: 5–7, 255–66, 1987–1999. + </para> + <para> + Ellipses…and…and…. + </para> +</section> +<section id="latex"> + <title>LaTeX</title> + <itemizedlist spacing="compact"> + <listitem> + <para> + </para> + </listitem> + <listitem> + <para> + 2 + 2 = 4 + </para> + </listitem> + <listitem> + <para> + <emphasis>x</emphasis> ∈ <emphasis>y</emphasis> + </para> + </listitem> + <listitem> + <para> + <emphasis>α</emphasis> ∧ <emphasis>ω</emphasis> + </para> + </listitem> + <listitem> + <para> + 223 + </para> + </listitem> + <listitem> + <para> + <emphasis>p</emphasis>-Tree + </para> + </listitem> + <listitem> + <para> + Here’s some display math: + $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$ + </para> + </listitem> + <listitem> + <para> + Here’s one that has a line break in it: + <emphasis>α</emphasis> + <emphasis>ω</emphasis> × <emphasis>x</emphasis><superscript>2</superscript>. + </para> + </listitem> + </itemizedlist> + <para> + These shouldn’t be math: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + To get the famous equation, write <literal>$e = mc^2$</literal>. + </para> + </listitem> + <listitem> + <para> + $22,000 is a <emphasis>lot</emphasis> of money. So is $34,000. (It + worked if <quote>lot</quote> is emphasized.) + </para> + </listitem> + <listitem> + <para> + Shoes ($20) and socks ($5). + </para> + </listitem> + <listitem> + <para> + Escaped <literal>$</literal>: $73 <emphasis>this should be + emphasized</emphasis> 23$. + </para> + </listitem> + </itemizedlist> + <para> + Here’s a LaTeX table: + </para> +</section> +<section id="special-characters"> + <title>Special Characters</title> + <para> + Here is some unicode: + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + I hat: Î + </para> + </listitem> + <listitem> + <para> + o umlaut: ö + </para> + </listitem> + <listitem> + <para> + section: § + </para> + </listitem> + <listitem> + <para> + set membership: ∈ + </para> + </listitem> + <listitem> + <para> + copyright: © + </para> + </listitem> + </itemizedlist> + <para> + AT&T has an ampersand in their name. + </para> + <para> + AT&T is another way to write it. + </para> + <para> + This & that. + </para> + <para> + 4 < 5. + </para> + <para> + 6 > 5. + </para> + <para> + Backslash: \ + </para> + <para> + Backtick: ` + </para> + <para> + Asterisk: * + </para> + <para> + Underscore: _ + </para> + <para> + Left brace: { + </para> + <para> + Right brace: } + </para> + <para> + Left bracket: [ + </para> + <para> + Right bracket: ] + </para> + <para> + Left paren: ( + </para> + <para> + Right paren: ) + </para> + <para> + Greater-than: > + </para> + <para> + Hash: # + </para> + <para> + Period: . + </para> + <para> + Bang: ! + </para> + <para> + Plus: + + </para> + <para> + Minus: - + </para> +</section> +<section id="links"> + <title>Links</title> + <section id="explicit"> + <title>Explicit</title> + <para> + Just a <link xlink:href="/url/">URL</link>. + </para> + <para> + <link xlink:href="/url/">URL and title</link>. + </para> + <para> + <link xlink:href="/url/">URL and title</link>. + </para> + <para> + <link xlink:href="/url/">URL and title</link>. + </para> + <para> + <link xlink:href="/url/">URL and title</link> + </para> + <para> + <link xlink:href="/url/">URL and title</link> + </para> + <para> + <link xlink:href="/url/with_underscore">with_underscore</link> + </para> + <para> + Email link (<email>nobody@nowhere.net</email>) + </para> + <para> + <link xlink:href="">Empty</link>. + </para> + </section> + <section id="reference"> + <title>Reference</title> + <para> + Foo <link xlink:href="/url/">bar</link>. + </para> + <para> + Foo <link xlink:href="/url/">bar</link>. + </para> + <para> + Foo <link xlink:href="/url/">bar</link>. + </para> + <para> + With <link xlink:href="/url/">embedded [brackets]</link>. + </para> + <para> + <link xlink:href="/url/">b</link> by itself should be a link. + </para> + <para> + Indented <link xlink:href="/url">once</link>. + </para> + <para> + Indented <link xlink:href="/url">twice</link>. + </para> + <para> + Indented <link xlink:href="/url">thrice</link>. + </para> + <para> + This should [not][] be a link. + </para> + <programlisting> +[not]: /url +</programlisting> + <para> + Foo <link xlink:href="/url/">bar</link>. + </para> + <para> + Foo <link xlink:href="/url/">biz</link>. + </para> + </section> + <section id="with-ampersands"> + <title>With ampersands</title> + <para> + Here’s a <link xlink:href="http://example.com/?foo=1&bar=2">link + with an ampersand in the URL</link>. + </para> + <para> + Here’s a link with an amersand in the link text: + <link xlink:href="http://att.com/">AT&T</link>. + </para> + <para> + Here’s an <link xlink:href="/script?foo=1&bar=2">inline link</link>. + </para> + <para> + Here’s an <link xlink:href="/script?foo=1&bar=2">inline link in + pointy braces</link>. + </para> + </section> + <section id="autolinks"> + <title>Autolinks</title> + <para> + With an ampersand: + <link xlink:href="http://example.com/?foo=1&bar=2">http://example.com/?foo=1&bar=2</link> + </para> + <itemizedlist spacing="compact"> + <listitem> + <para> + In a list? + </para> + </listitem> + <listitem> + <para> + <link xlink:href="http://example.com/">http://example.com/</link> + </para> + </listitem> + <listitem> + <para> + It should. + </para> + </listitem> + </itemizedlist> + <para> + An e-mail address: <email>nobody@nowhere.net</email> + </para> + <blockquote> + <para> + Blockquoted: + <link xlink:href="http://example.com/">http://example.com/</link> + </para> + </blockquote> + <para> + Auto-links should not occur here: + <literal><http://example.com/></literal> + </para> + <programlisting> +or here: <http://example.com/> +</programlisting> + </section> +</section> +<section id="images"> + <title>Images</title> + <para> + From <quote>Voyage dans la Lune</quote> by Georges Melies (1902): + </para> + <figure> + <title>lalune</title> + <mediaobject> + <imageobject> + <imagedata fileref="lalune.jpg" /> + </imageobject> + <textobject><phrase>lalune</phrase></textobject> + </mediaobject> + </figure> + <para> + Here is a movie <inlinemediaobject> + <imageobject> + <imagedata fileref="movie.jpg" /> + </imageobject> + </inlinemediaobject> icon. + </para> +</section> +<section id="footnotes"> + <title>Footnotes</title> + <para> + Here is a footnote reference,<footnote> + <para> + Here is the footnote. It can go anywhere after the footnote reference. + It need not be placed at the end of the document. + </para> + </footnote> and another.<footnote> + <para> + Here’s the long note. This one contains multiple blocks. + </para> + <para> + Subsequent blocks are indented to show that they belong to the + footnote (as with list items). + </para> + <programlisting> + { <code> } +</programlisting> + <para> + If you want, you can indent every line, but you can also be lazy and + just indent the first line of each block. + </para> + </footnote> This should <emphasis>not</emphasis> be a footnote reference, + because it contains a space.[^my note] Here is an inline note.<footnote> + <para> + This is <emphasis>easier</emphasis> to type. Inline notes may contain + <link xlink:href="http://google.com">links</link> and + <literal>]</literal> verbatim characters, as well as [bracketed text]. + </para> + </footnote> + </para> + <blockquote> + <para> + Notes can go in quotes.<footnote> + <para> + In quote. + </para> + </footnote> + </para> + </blockquote> + <orderedlist numeration="arabic" spacing="compact"> + <listitem> + <para> + And in list items.<footnote> + <para> + In list. + </para> + </footnote> + </para> + </listitem> + </orderedlist> + <para> + This paragraph should not be part of the note, as it is not indented. + </para> +</section> +</article> diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index fe1f8296a..79fcdde8a 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -459,7 +459,7 @@ Ellipses…and…and…. * $\alpha \wedge \omega$ * $223$ * $p$-Tree - * Here’s some display math: $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ + * Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$ * Here’s one that has a line break in it: $\alpha + \omega \times x^2$. These shouldn’t be math: diff --git a/tests/writers-lang-and-dir.latex b/tests/writers-lang-and-dir.latex index 056809a5e..346675353 100644 --- a/tests/writers-lang-and-dir.latex +++ b/tests/writers-lang-and-dir.latex @@ -27,16 +27,16 @@ breaklinks=true} \urlstyle{same} % don't use monospace font for urls \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - \usepackage[shorthands=off,ngerman,british,ngerman,spanish,french,main=english]{babel} + \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel} \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}} - \newenvironment{german}[1]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}} + \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}} \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}} - \newenvironment{english}[1]{\begin{otherlanguage}{british}}{\end{otherlanguage}} + \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}} \let\oritextspanish\textspanish \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}} \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}} \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}} - \newenvironment{french}[1]{\begin{otherlanguage}{french}}{\end{otherlanguage}} + \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}} \else \usepackage{polyglossia} \setmainlanguage[]{english} |