git.iko.soy/typeable/pandoc
on master help sign in
Updated for removed unMeta, unFormat in pandoc-types.
commit3e8bd8aa15a57c3dc87772049aabedeb1e0c7582 authorJohn MacFarlane <fiddlosopher@gmail.com> dateWed 14 Aug 2013, 23:24 (13 years ago) parent2a6e632
17 files changed+94−83
pandoc.cabal+9 scripts/comments.py+1−2 scripts/myemph.py+5−2 scripts/tikz.py+1−1 src/Text/Pandoc/Writers/RST.hs+2−2 tests/docbook-reader.native+1−1 tests/haddock-reader.native+1−1 tests/html-reader.native+1−1 tests/latex-reader.native+4−4 tests/markdown-reader-more.native+5−5 tests/mediawiki-reader.native+11−11 tests/opml-reader.native+1−1 tests/rst-reader.native+4−4 tests/s5.native+1−1 tests/testsuite.native+19−19 tests/textile-reader.native+9−9 tests/writer.native+19−19
pandoc.cabal+9
@@ -112,6 +112,15 @@ Extra-Source-Files:
112112 -- generated man pages (produced post-build)
113113 man/man1/pandoc.1,
114114 man/man5/pandoc_markdown.5,
115+ -- python library and sample python scripts
116+ scripts/abc.py,
117+ scripts/comments.py,
118+ scripts/graphviz.py,
119+ scripts/pandoc.py,
120+ scripts/caps.py,
121+ scripts/deemph.py,
122+ scripts/myemph.py,
123+ scripts/tikz.py,
115124 -- tests
116125 tests/bodybg.gif,
117126 tests/docbook-reader.docbook
scripts/comments.py+1−2
@@ -15,8 +15,7 @@ incomment = False
1515def comment(k,v,fmt):
1616 global incomment
1717 if k == 'RawBlock':
18− f, s = v
19− fmt = f['unFormat']
18+ fmt, s = v
2019 if fmt == "html":
2120 if re.search("<!-- BEGIN COMMENT -->", s):
2221 incomment = True
scripts/myemph.py+5−2
@@ -1,5 +1,5 @@
11#!/usr/bin/env python
2−from pandoc import toJSONFilter, rawInline
2+from pandoc import toJSONFilter
33
44"""
55Pandoc filter that causes emphasis to be rendered using
@@ -7,9 +7,12 @@ the custom macro '\myemph{...}' rather than '\emph{...}'
77in latex. Other output formats are unaffected.
88"""
99
10+def latex(s):
11+ return {'RawInline': ['latex', s]}
12+
1013def myemph(k, v, f):
1114 if k == 'Emph' and f == 'latex':
12− return [rawInline("latex", "\\myemph{")] + v + [rawInline("latex","}")]
15+ return [latex('\\myemph{')] + v + [latex('}')]
1316
1417if __name__ == "__main__":
1518 toJSONFilter(myemph)
scripts/tikz.py+1−1
@@ -44,7 +44,7 @@ def tikz2image(tikz, filetype, outfile):
4444def tikz(key, value, format):
4545 if key == 'RawBlock':
4646 [fmt, code] = value
47− if fmt['unFormat'] == "latex" and re.match("\\\\begin{tikzpicture}", code):
47+ if fmt == "latex" and re.match("\\\\begin{tikzpicture}", code):
4848 outfile = imagedir + '/' + sha1(code)
4949 if format == "html":
5050 filetype = "png"
src/Text/Pandoc/Writers/RST.hs+2−2
@@ -176,10 +176,10 @@ blockToRST (Para inlines)
176176 | otherwise = do
177177 contents <- inlineListToRST inlines
178178 return $ contents <> blankline
179−blockToRST (RawBlock f str)
179+blockToRST (RawBlock f@(Format f') str)
180180 | f == "rst" = return $ text str
181181 | otherwise = return $ blankline <> ".. raw:: " <>
182− text (map toLower $ unFormat f) $+$
182+ text (map toLower f') $+$
183183 (nest 3 $ text str) $$ blankline
184184blockToRST HorizontalRule =
185185 return $ blankline $$ "--------------" $$ blankline
tests/docbook-reader.native+1−1
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
1+Pandoc (Meta (fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
22[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
33,Header 1 ("",[],[]) [Str "Headers"]
44,Header 2 ("",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embedded",Space,Str "link"] ("/url","")]
tests/haddock-reader.native+1−1
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList []})
1+Pandoc (Meta (fromList []))
22[Para [Str "This",Space,Str "file",Space,Str "tests",Space,Str "the",Space,Str "Pandoc",Space,Str "reader",Space,Str "for",Space,Str "Haddock.",Space,Str "We've",Space,Str "borrowed",Space,Str "examples",Space,Str "from",Space,Str "Haddock's",Space,Str "documentation:",Space,Link [Str "http://www.haskell.org/haddock/doc/html/ch03s08.html"] ("http://www.haskell.org/haddock/doc/html/ch03s08.html","http://www.haskell.org/haddock/doc/html/ch03s08.html"),Str "."]
33,Para [Str "The",Space,Str "following",Space,Str "characters",Space,Str "have",Space,Str "special",Space,Str "meanings",Space,Str "in",Space,Str "Haddock,",Space,Str "/,",Space,Str "',",Space,Str "`,",Space,Str "\",",Space,Str "@,",Space,Str "<,",Space,Str "so",Space,Str "they",Space,Str "must",Space,Str "be",Space,Str "escaped."]
44,Para [Str "*",Space,Str "This",Space,Str "is",Space,Str "a",Space,Str "paragraph,",Space,Str "not",Space,Str "a",Space,Str "list",Space,Str "item.",Space,Str ">",Space,Str "This",Space,Str "sentence",Space,Str "is",Space,Str "not",Space,Str "code.",Space,Str ">>>",Space,Str "This",Space,Str "is",Space,Str "not",Space,Str "an",Space,Str "example."]
tests/html-reader.native+1−1
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
1+Pandoc (Meta (fromList [("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
22[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Str ".",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber",Str "'",Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite",Str "."]
33,HorizontalRule
44,Header 1 ("",[],[]) [Str "Headers"]
tests/latex-reader.native+4−4
@@ -1,5 +1,5 @@
1−Pandoc (Meta {unMeta = fromList [("authors",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
2−[RawBlock (Format {unFormat = "latex"}) "\\maketitle"
1+Pandoc (Meta (fromList [("authors",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
2+[RawBlock (Format "latex") "\\maketitle"
33,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
44,HorizontalRule
55,Header 1 ("",[],[]) [Str "Headers"]
@@ -260,8 +260,8 @@ Pandoc (Meta {unMeta = fromList [("authors",MetaList [MetaInlines [Str "John",Sp
260260,HorizontalRule
261261,Header 1 ("",[],[]) [Str "LaTeX"]
262262,BulletList
263− [[Para [Cite [Citation {citationId = "smith.1899", citationPrefix = [], citationSuffix = [Str "22-23"], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [RawInline (Format {unFormat = "latex"}) "\\cite[22-23]{smith.1899}"]]]
264− ,[Para [RawInline (Format {unFormat = "latex"}) "\\doublespacing"]]
263+ [[Para [Cite [Citation {citationId = "smith.1899", citationPrefix = [], citationSuffix = [Str "22-23"], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cite[22-23]{smith.1899}"]]]
264+ ,[Para [RawInline (Format "latex") "\\doublespacing"]]
265265 ,[Para [Math InlineMath "2+2=4"]]
266266 ,[Para [Math InlineMath "x \\in y"]]
267267 ,[Para [Math InlineMath "\\alpha \\wedge \\omega"]]
tests/markdown-reader-more.native+5−5
@@ -2,9 +2,9 @@
22,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"]
33,Para [Link [Str "foo"] ("/url",""),Space,Str "and",Space,Link [Str "bar"] ("/url","title")]
44,Header 2 ("raw-context-environments",[],[]) [Str "Raw",Space,Str "ConTeXt",Space,Str "environments"]
5−,Plain [RawInline (Format {unFormat = "tex"}) "\\placeformula "]
6−,RawBlock (Format {unFormat = "context"}) "\\startformula\n L_{1} = L_{2}\n \\stopformula"
7−,RawBlock (Format {unFormat = "context"}) "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]"
5+,Plain [RawInline (Format "tex") "\\placeformula "]
6+,RawBlock (Format "context") "\\startformula\n L_{1} = L_{2}\n \\stopformula"
7+,RawBlock (Format "context") "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]"
88,Header 2 ("urls-with-spaces",[],[]) [Str "URLs",Space,Str "with",Space,Str "spaces"]
99,Para [Link [Str "foo"] ("/bar%20and%20baz",""),Space,Link [Str "foo"] ("/bar%20and%20baz",""),Space,Link [Str "foo"] ("/bar%20and%20baz",""),Space,Link [Str "foo"] ("bar%20baz","title")]
1010,Para [Link [Str "baz"] ("/foo%20foo",""),Space,Link [Str "bam"] ("/foo%20fee",""),Space,Link [Str "bork"] ("/foo/zee%20zob","title")]
@@ -12,13 +12,13 @@
1212,HorizontalRule
1313,HorizontalRule
1414,Header 2 ("raw-html-before-header",[],[]) [Str "Raw",Space,Str "HTML",Space,Str "before",Space,Str "header"]
15−,Para [RawInline (Format {unFormat = "html"}) "<a>",RawInline (Format {unFormat = "html"}) "</a>"]
15+,Para [RawInline (Format "html") "<a>",RawInline (Format "html") "</a>"]
1616,Header 3 ("my-header",[],[]) [Str "my",Space,Str "header"]
1717,Header 2 ("in-math",[],[]) [Str "$",Space,Str "in",Space,Str "math"]
1818,Para [Math InlineMath "\\$2 + \\$3"]
1919,Header 2 ("commented-out-list-item",[],[]) [Str "Commented-out",Space,Str "list",Space,Str "item"]
2020,BulletList
21− [[Plain [Str "one",Space,RawInline (Format {unFormat = "html"}) "<!--\n- two\n-->"]]
21+ [[Plain [Str "one",Space,RawInline (Format "html") "<!--\n- two\n-->"]]
2222 ,[Plain [Str "three"]]]
2323,Header 2 ("backslash-newline",[],[]) [Str "Backslash",Space,Str "newline"]
2424,Para [Str "hi",LineBreak,Str "there"]
tests/mediawiki-reader.native+11−11
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList []})
1+Pandoc (Meta (fromList []))
22[Header 1 ("",[],[]) [Str "header"]
33,Header 2 ("",[],[]) [Str "header",Space,Str "level",Space,Str "two"]
44,Header 3 ("",[],[]) [Str "header",Space,Str "level",Space,Str "3"]
@@ -51,11 +51,11 @@ Pandoc (Meta {unMeta = fromList []})
5151,Para [Str "bud"]
5252,Para [Str "another"]
5353,Header 2 ("",[],[]) [Str "raw",Space,Str "html"]
54−,Para [Str "hi",Space,RawInline (Format {unFormat = "html"}) "<span style=\"color:red\">",Emph [Str "there"],RawInline (Format {unFormat = "html"}) "</span>",Str "."]
55−,Para [RawInline (Format {unFormat = "html"}) "<ins>",Str "inserted",RawInline (Format {unFormat = "html"}) "</ins>"]
56−,RawBlock (Format {unFormat = "html"}) "<div class=\"special\">"
54+,Para [Str "hi",Space,RawInline (Format "html") "<span style=\"color:red\">",Emph [Str "there"],RawInline (Format "html") "</span>",Str "."]
55+,Para [RawInline (Format "html") "<ins>",Str "inserted",RawInline (Format "html") "</ins>"]
56+,RawBlock (Format "html") "<div class=\"special\">"
5757,Para [Str "hi",Space,Emph [Str "there"]]
58−,RawBlock (Format {unFormat = "html"}) "</div>"
58+,RawBlock (Format "html") "</div>"
5959,Header 2 ("",[],[]) [Str "sup,",Space,Str "sub,",Space,Str "del"]
6060,Para [Str "H",Subscript [Str "2"],Str "O",Space,Str "base",Superscript [Emph [Str "exponent"]],Space,Strikeout [Str "hello"]]
6161,Header 2 ("",[],[]) [Str "inline",Space,Str "code"]
@@ -140,7 +140,7 @@ Pandoc (Meta {unMeta = fromList []})
140140 ,[Plain [Str "this",Space,Str "looks",Space,Str "like",Space,Str "a",Space,Str "continuation"]]
141141 ,[Plain [Str "and",Space,Str "is",Space,Str "often",Space,Str "used"]]
142142 ,[Plain [Str "instead",LineBreak,Str "of",Space,Str "<br/>"]]])]]
143− ,[Plain [RawInline (Format {unFormat = "mediawiki"}) "{{{template\n|author=John\n|title=My Book\n}}}"]
143+ ,[Plain [RawInline (Format "mediawiki") "{{{template\n|author=John\n|title=My Book\n}}}"]
144144 ,OrderedList (1,DefaultStyle,DefaultDelim)
145145 [[Plain [Str "five",Space,Str "sub",Space,Str "1"]
146146 ,OrderedList (1,DefaultStyle,DefaultDelim)
@@ -168,16 +168,16 @@ Pandoc (Meta {unMeta = fromList []})
168168,Para [Code ("",[],[]) "\160hell\160\160\160\160\160\160yeah"]
169169,Para [Code ("",[],[]) "Start\160with\160a\160space\160in\160the\160first\160column,",LineBreak,Code ("",[],[]) "(before\160the\160<nowiki>).",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "Then\160your\160block\160format\160will\160be",LineBreak,Code ("",[],[]) "\160\160\160\160maintained.",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "This\160is\160good\160for\160copying\160in\160code\160blocks:",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "def\160function():",LineBreak,Code ("",[],[]) "\160\160\160\160\"\"\"documentation\160string\"\"\"",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "\160\160\160\160if\160True:",LineBreak,Code ("",[],[]) "\160\160\160\160\160\160\160\160print\160True",LineBreak,Code ("",[],[]) "\160\160\160\160else:",LineBreak,Code ("",[],[]) "\160\160\160\160\160\160\160\160print\160False"]
170170,Para [Str "Not"]
171−,RawBlock (Format {unFormat = "html"}) "<hr/>"
171+,RawBlock (Format "html") "<hr/>"
172172,Para [Str "preformatted"]
173173,Para [Str "Don't",Space,Str "need"]
174174,Para [Code ("",[],[]) "a\160blank\160line"]
175175,Para [Str "around",Space,Str "a",Space,Str "preformatted",Space,Str "block."]
176176,Header 2 ("",[],[]) [Str "templates"]
177−,RawBlock (Format {unFormat = "mediawiki"}) "{{Welcome}}"
178−,RawBlock (Format {unFormat = "mediawiki"}) "{{Foo:Bar}}"
179−,RawBlock (Format {unFormat = "mediawiki"}) "{{Thankyou|all your effort|Me}}"
180−,Para [Str "Written",Space,RawInline (Format {unFormat = "mediawiki"}) "{{{date}}}",Space,Str "by",Space,RawInline (Format {unFormat = "mediawiki"}) "{{{name}}}",Str "."]
177+,RawBlock (Format "mediawiki") "{{Welcome}}"
178+,RawBlock (Format "mediawiki") "{{Foo:Bar}}"
179+,RawBlock (Format "mediawiki") "{{Thankyou|all your effort|Me}}"
180+,Para [Str "Written",Space,RawInline (Format "mediawiki") "{{{date}}}",Space,Str "by",Space,RawInline (Format "mediawiki") "{{{name}}}",Str "."]
181181,Header 2 ("",[],[]) [Str "tables"]
182182,Table [] [AlignDefault,AlignDefault] [0.0,0.0]
183183 [[]
tests/opml-reader.native+1−1
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Dave",Space,Str "Winer"]]),("date",MetaInlines [Str "Thu,",Space,Str "14",Space,Str "Jul",Space,Str "2005",Space,Str "23:41:05",Space,Str "GMT"]),("title",MetaInlines [Str "States"])]})
1+Pandoc (Meta (fromList [("author",MetaList [MetaInlines [Str "Dave",Space,Str "Winer"]]),("date",MetaInlines [Str "Thu,",Space,Str "14",Space,Str "Jul",Space,Str "2005",Space,Str "23:41:05",Space,Str "GMT"]),("title",MetaInlines [Str "States"])]))
22[Header 1 ("",[],[]) [Str "United",Space,Str "States"]
33,Header 2 ("",[],[]) [Str "Far",Space,Str "West"]
44,Header 3 ("",[],[]) [Str "Alaska"]
tests/rst-reader.native+4−4
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("authors",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("revision",MetaBlocks [Para [Str "3"]]),("subtitle",MetaInlines [Str "Subtitle"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
1+Pandoc (Meta (fromList [("authors",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("revision",MetaBlocks [Para [Str "3"]]),("subtitle",MetaInlines [Str "Subtitle"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
22[Header 1 ("",[],[]) [Str "Level",Space,Str "one",Space,Str "header"]
33,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
44,Header 2 ("",[],[]) [Str "Level",Space,Str "two",Space,Str "header"]
@@ -172,11 +172,11 @@ Pandoc (Meta {unMeta = fromList [("authors",MetaList [MetaInlines [Str "John",Sp
172172 [[Para [Str "123-4567"]]])]
173173,Header 1 ("",[],[]) [Str "HTML",Space,Str "Blocks"]
174174,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
175−,RawBlock (Format {unFormat = "html"}) "<div>foo</div>"
175+,RawBlock (Format "html") "<div>foo</div>"
176176,Para [Str "Now,",Space,Str "nested:"]
177−,RawBlock (Format {unFormat = "html"}) "<div>\n <div>\n <div>\n foo\n </div>\n </div>\n</div>"
177+,RawBlock (Format "html") "<div>\n <div>\n <div>\n foo\n </div>\n </div>\n</div>"
178178,Header 1 ("",[],[]) [Str "LaTeX",Space,Str "Block"]
179−,RawBlock (Format {unFormat = "latex"}) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
179+,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
180180,Header 1 ("",[],[]) [Str "Inline",Space,Str "Markup"]
181181,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ".",Space,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str "."]
182182,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
tests/s5.native+1−1
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Sam",Space,Str "Smith"],MetaInlines [Str "Jen",Space,Str "Jones"]]),("date",MetaInlines [Str "July",Space,Str "15,",Space,Str "2006"]),("title",MetaInlines [Str "My",Space,Str "S5",Space,Str "Document"])]})
1+Pandoc (Meta (fromList [("author",MetaList [MetaInlines [Str "Sam",Space,Str "Smith"],MetaInlines [Str "Jen",Space,Str "Jones"]]),("date",MetaInlines [Str "July",Space,Str "15,",Space,Str "2006"]),("title",MetaInlines [Str "My",Space,Str "S5",Space,Str "Document"])]))
22[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"]
33,BulletList
44 [[Plain [Str "first",Space,Str "bullet"]]
tests/testsuite.native+19−19
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
1+Pandoc (Meta (fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
22[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
33,HorizontalRule
44,Header 1 ("headers",[],[]) [Str "Headers"]
@@ -228,45 +228,45 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
228228 ,[Plain [Str "sublist"]]]]])]
229229,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"]
230230,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
231−,RawBlock (Format {unFormat = "html"}) "<div>"
231+,RawBlock (Format "html") "<div>"
232232,Plain [Str "foo"]
233−,RawBlock (Format {unFormat = "html"}) "</div>\n"
233+,RawBlock (Format "html") "</div>\n"
234234,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
235−,RawBlock (Format {unFormat = "html"}) "<div>\n<div>\n<div>"
235+,RawBlock (Format "html") "<div>\n<div>\n<div>"
236236,Plain [Str "foo"]
237−,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n<div>"
237+,RawBlock (Format "html") "</div>\n</div>\n<div>"
238238,Plain [Str "bar"]
239−,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n"
239+,RawBlock (Format "html") "</div>\n</div>\n"
240240,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
241−,RawBlock (Format {unFormat = "html"}) "<table>\n<tr>\n<td>"
241+,RawBlock (Format "html") "<table>\n<tr>\n<td>"
242242,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
243−,RawBlock (Format {unFormat = "html"}) "</td>\n<td>"
243+,RawBlock (Format "html") "</td>\n<td>"
244244,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
245−,RawBlock (Format {unFormat = "html"}) "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
245+,RawBlock (Format "html") "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
246246,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
247−,RawBlock (Format {unFormat = "html"}) "<div>\n "
247+,RawBlock (Format "html") "<div>\n "
248248,Plain [Str "foo"]
249−,RawBlock (Format {unFormat = "html"}) "</div>\n"
249+,RawBlock (Format "html") "</div>\n"
250250,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
251251,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
252252,Para [Str "As",Space,Str "should",Space,Str "this:"]
253253,CodeBlock ("",[],[]) "<div>foo</div>"
254254,Para [Str "Now,",Space,Str "nested:"]
255−,RawBlock (Format {unFormat = "html"}) "<div>\n <div>\n <div>\n "
255+,RawBlock (Format "html") "<div>\n <div>\n <div>\n "
256256,Plain [Str "foo"]
257−,RawBlock (Format {unFormat = "html"}) "</div>\n </div>\n</div>\n"
257+,RawBlock (Format "html") "</div>\n </div>\n</div>\n"
258258,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
259−,RawBlock (Format {unFormat = "html"}) "<!-- Comment -->\n"
259+,RawBlock (Format "html") "<!-- Comment -->\n"
260260,Para [Str "Multiline:"]
261−,RawBlock (Format {unFormat = "html"}) "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
261+,RawBlock (Format "html") "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
262262,Para [Str "Code",Space,Str "block:"]
263263,CodeBlock ("",[],[]) "<!-- Comment -->"
264264,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"]
265−,RawBlock (Format {unFormat = "html"}) "<!-- foo --> \n"
265+,RawBlock (Format "html") "<!-- foo --> \n"
266266,Para [Str "Code:"]
267267,CodeBlock ("",[],[]) "<hr />"
268268,Para [Str "Hr\8217s:"]
269−,RawBlock (Format {unFormat = "html"}) "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
269+,RawBlock (Format "html") "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
270270,HorizontalRule
271271,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"]
272272,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
@@ -294,7 +294,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
294294,HorizontalRule
295295,Header 1 ("latex",[],[]) [Str "LaTeX"]
296296,BulletList
297− [[Plain [RawInline (Format {unFormat = "tex"}) "\\cite[22-23]{smith.1899}"]]
297+ [[Plain [RawInline (Format "tex") "\\cite[22-23]{smith.1899}"]]
298298 ,[Plain [Math InlineMath "2+2=4"]]
299299 ,[Plain [Math InlineMath "x \\in y"]]
300300 ,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]]
@@ -309,7 +309,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
309309 ,[Plain [Str "Shoes",Space,Str "($20)",Space,Str "and",Space,Str "socks",Space,Str "($5)."]]
310310 ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$."]]]
311311,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
312−,RawBlock (Format {unFormat = "latex"}) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
312+,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
313313,HorizontalRule
314314,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"]
315315,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"]
tests/textile-reader.native+9−9
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList []})
1+Pandoc (Meta (fromList []))
22[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Space,Str "Textile",Space,Str "Reader",Str ".",Space,Str "Part",Space,Str "of",Space,Str "it",Space,Str "comes",LineBreak,Str "from",Space,Str "John",Space,Str "Gruber",Str "\8217",Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite",Str "."]
33,HorizontalRule
44,Header 1 ("",[],[]) [Str "Headers"]
@@ -137,23 +137,23 @@ Pandoc (Meta {unMeta = fromList []})
137137,Header 1 ("",[],[]) [Str "Entities"]
138138,Para [Str "*",LineBreak,Str "&"]
139139,Header 1 ("",[],[]) [Str "Raw",Space,Str "HTML"]
140−,Para [Str "However",Str ",",Space,RawInline (Format {unFormat = "html"}) "<strong>",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,RawInline (Format {unFormat = "html"}) "</strong>",Space,Str "are",Space,Str "accepted",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
141−,RawBlock (Format {unFormat = "html"}) "<div class=\"foobar\">"
140+,Para [Str "However",Str ",",Space,RawInline (Format "html") "<strong>",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,RawInline (Format "html") "</strong>",Space,Str "are",Space,Str "accepted",Str ",",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"]
141+,RawBlock (Format "html") "<div class=\"foobar\">"
142142,Para [Str "any",Space,Strong [Str "Raw",Space,Str "HTML",Space,Str "Block"],Space,Str "with",Space,Str "bold"]
143−,RawBlock (Format {unFormat = "html"}) "</div>"
143+,RawBlock (Format "html") "</div>"
144144,Para [Str "Html",Space,Str "blocks",Space,Str "can",Space,Str "be"]
145−,RawBlock (Format {unFormat = "html"}) "<div>"
145+,RawBlock (Format "html") "<div>"
146146,Para [Str "inlined"]
147−,RawBlock (Format {unFormat = "html"}) "</div>"
147+,RawBlock (Format "html") "</div>"
148148,Para [Str "as",Space,Str "well",Str "."]
149149,BulletList
150150 [[Plain [Str "this",Space,Str "<",Str "div",Str ">",Space,Str "won",Str "\8217",Str "t",Space,Str "produce",Space,Str "raw",Space,Str "html",Space,Str "blocks",Space,Str "<",Str "/div",Str ">"]]
151− ,[Plain [Str "but",Space,Str "this",Space,RawInline (Format {unFormat = "html"}) "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,RawInline (Format {unFormat = "html"}) "</strong>"]]]
151+ ,[Plain [Str "but",Space,Str "this",Space,RawInline (Format "html") "<strong>",Space,Str "will",Space,Str "produce",Space,Str "inline",Space,Str "html",Space,RawInline (Format "html") "</strong>"]]]
152152,Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"]
153153,Header 1 ("",[],[]) [Str "Raw",Space,Str "LaTeX"]
154154,Para [Str "This",Space,Str "Textile",Space,Str "reader",Space,Str "also",Space,Str "accepts",Space,Str "raw",Space,Str "LaTeX",Space,Str "for",Space,Str "blocks",Space,Str ":"]
155−,RawBlock (Format {unFormat = "latex"}) "\\begin{itemize}\n \\item one\n \\item two\n\\end{itemize}"
156−,Para [Str "and",Space,Str "for",Space,RawInline (Format {unFormat = "latex"}) "\\emph{inlines}",Str "."]
155+,RawBlock (Format "latex") "\\begin{itemize}\n \\item one\n \\item two\n\\end{itemize}"
156+,Para [Str "and",Space,Str "for",Space,RawInline (Format "latex") "\\emph{inlines}",Str "."]
157157,Header 1 ("",[],[]) [Str "Acronyms",Space,Str "and",Space,Str "marks"]
158158,Para [Str "PBS (Public Broadcasting System)"]
159159,Para [Str "Hi",Str "\8482"]
tests/writer.native+19−19
@@ -1,4 +1,4 @@
1−Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
1+Pandoc (Meta (fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
22[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
33,HorizontalRule
44,Header 1 ("headers",[],[]) [Str "Headers"]
@@ -228,45 +228,45 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
228228 ,[Plain [Str "sublist"]]]]])]
229229,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"]
230230,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
231−,RawBlock (Format {unFormat = "html"}) "<div>"
231+,RawBlock (Format "html") "<div>"
232232,Plain [Str "foo"]
233−,RawBlock (Format {unFormat = "html"}) "</div>\n"
233+,RawBlock (Format "html") "</div>\n"
234234,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
235−,RawBlock (Format {unFormat = "html"}) "<div>\n<div>\n<div>"
235+,RawBlock (Format "html") "<div>\n<div>\n<div>"
236236,Plain [Str "foo"]
237−,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n<div>"
237+,RawBlock (Format "html") "</div>\n</div>\n<div>"
238238,Plain [Str "bar"]
239−,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n"
239+,RawBlock (Format "html") "</div>\n</div>\n"
240240,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
241−,RawBlock (Format {unFormat = "html"}) "<table>\n<tr>\n<td>"
241+,RawBlock (Format "html") "<table>\n<tr>\n<td>"
242242,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
243−,RawBlock (Format {unFormat = "html"}) "</td>\n<td>"
243+,RawBlock (Format "html") "</td>\n<td>"
244244,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
245−,RawBlock (Format {unFormat = "html"}) "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
245+,RawBlock (Format "html") "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
246246,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
247−,RawBlock (Format {unFormat = "html"}) "<div>\n "
247+,RawBlock (Format "html") "<div>\n "
248248,Plain [Str "foo"]
249−,RawBlock (Format {unFormat = "html"}) "</div>\n"
249+,RawBlock (Format "html") "</div>\n"
250250,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
251251,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
252252,Para [Str "As",Space,Str "should",Space,Str "this:"]
253253,CodeBlock ("",[],[]) "<div>foo</div>"
254254,Para [Str "Now,",Space,Str "nested:"]
255−,RawBlock (Format {unFormat = "html"}) "<div>\n <div>\n <div>\n "
255+,RawBlock (Format "html") "<div>\n <div>\n <div>\n "
256256,Plain [Str "foo"]
257−,RawBlock (Format {unFormat = "html"}) "</div>\n </div>\n</div>\n"
257+,RawBlock (Format "html") "</div>\n </div>\n</div>\n"
258258,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
259−,RawBlock (Format {unFormat = "html"}) "<!-- Comment -->\n"
259+,RawBlock (Format "html") "<!-- Comment -->\n"
260260,Para [Str "Multiline:"]
261−,RawBlock (Format {unFormat = "html"}) "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
261+,RawBlock (Format "html") "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
262262,Para [Str "Code",Space,Str "block:"]
263263,CodeBlock ("",[],[]) "<!-- Comment -->"
264264,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"]
265−,RawBlock (Format {unFormat = "html"}) "<!-- foo --> \n"
265+,RawBlock (Format "html") "<!-- foo --> \n"
266266,Para [Str "Code:"]
267267,CodeBlock ("",[],[]) "<hr />"
268268,Para [Str "Hr\8217s:"]
269−,RawBlock (Format {unFormat = "html"}) "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
269+,RawBlock (Format "html") "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
270270,HorizontalRule
271271,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"]
272272,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
@@ -294,7 +294,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
294294,HorizontalRule
295295,Header 1 ("latex",[],[]) [Str "LaTeX"]
296296,BulletList
297− [[Plain [RawInline (Format {unFormat = "tex"}) "\\cite[22-23]{smith.1899}"]]
297+ [[Plain [RawInline (Format "tex") "\\cite[22-23]{smith.1899}"]]
298298 ,[Plain [Math InlineMath "2+2=4"]]
299299 ,[Plain [Math InlineMath "x \\in y"]]
300300 ,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]]
@@ -309,7 +309,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
309309 ,[Plain [Str "Shoes",Space,Str "($20)",Space,Str "and",Space,Str "socks",Space,Str "($5)."]]
310310 ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$."]]]
311311,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
312−,RawBlock (Format {unFormat = "latex"}) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
312+,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
313313,HorizontalRule
314314,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"]
315315,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"]