Updated for removed unMeta, unFormat in pandoc-types.

This commit is contained in:
John MacFarlane 2013-08-14 23:24:45 -07:00
parent 2a6e6324a6
commit 3e8bd8aa15
17 changed files with 94 additions and 83 deletions

View file

@ -112,6 +112,15 @@ Extra-Source-Files:
-- generated man pages (produced post-build)
man/man1/pandoc.1,
man/man5/pandoc_markdown.5,
-- python library and sample python scripts
scripts/abc.py,
scripts/comments.py,
scripts/graphviz.py,
scripts/pandoc.py,
scripts/caps.py,
scripts/deemph.py,
scripts/myemph.py,
scripts/tikz.py,
-- tests
tests/bodybg.gif,
tests/docbook-reader.docbook

View file

@ -15,8 +15,7 @@ incomment = False
def comment(k,v,fmt):
global incomment
if k == 'RawBlock':
f, s = v
fmt = f['unFormat']
fmt, s = v
if fmt == "html":
if re.search("<!-- BEGIN COMMENT -->", s):
incomment = True

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python
from pandoc import toJSONFilter, rawInline
from pandoc import toJSONFilter
"""
Pandoc filter that causes emphasis to be rendered using
@ -7,9 +7,12 @@ the custom macro '\myemph{...}' rather than '\emph{...}'
in latex. Other output formats are unaffected.
"""
def latex(s):
return {'RawInline': ['latex', s]}
def myemph(k, v, f):
if k == 'Emph' and f == 'latex':
return [rawInline("latex", "\\myemph{")] + v + [rawInline("latex","}")]
return [latex('\\myemph{')] + v + [latex('}')]
if __name__ == "__main__":
toJSONFilter(myemph)

View file

@ -44,7 +44,7 @@ def tikz2image(tikz, filetype, outfile):
def tikz(key, value, format):
if key == 'RawBlock':
[fmt, code] = value
if fmt['unFormat'] == "latex" and re.match("\\\\begin{tikzpicture}", code):
if fmt == "latex" and re.match("\\\\begin{tikzpicture}", code):
outfile = imagedir + '/' + sha1(code)
if format == "html":
filetype = "png"

View file

@ -176,10 +176,10 @@ blockToRST (Para inlines)
| otherwise = do
contents <- inlineListToRST inlines
return $ contents <> blankline
blockToRST (RawBlock f str)
blockToRST (RawBlock f@(Format f') str)
| f == "rst" = return $ text str
| otherwise = return $ blankline <> ".. raw:: " <>
text (map toLower $ unFormat f) $+$
text (map toLower f') $+$
(nest 3 $ text str) $$ blankline
blockToRST HorizontalRule =
return $ blankline $$ "--------------" $$ blankline

View file

@ -1,4 +1,4 @@
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"])]})
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"])]))
[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."]
,Header 1 ("",[],[]) [Str "Headers"]
,Header 2 ("",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embedded",Space,Str "link"] ("/url","")]

View file

@ -1,4 +1,4 @@
Pandoc (Meta {unMeta = fromList []})
Pandoc (Meta (fromList []))
[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 "."]
,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."]
,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."]

View file

@ -1,4 +1,4 @@
Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]})
Pandoc (Meta (fromList [("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]))
[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 "."]
,HorizontalRule
,Header 1 ("",[],[]) [Str "Headers"]

View file

@ -1,5 +1,5 @@
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"])]})
[RawBlock (Format {unFormat = "latex"}) "\\maketitle"
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"])]))
[RawBlock (Format "latex") "\\maketitle"
,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."]
,HorizontalRule
,Header 1 ("",[],[]) [Str "Headers"]
@ -260,8 +260,8 @@ Pandoc (Meta {unMeta = fromList [("authors",MetaList [MetaInlines [Str "John",Sp
,HorizontalRule
,Header 1 ("",[],[]) [Str "LaTeX"]
,BulletList
[[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}"]]]
,[Para [RawInline (Format {unFormat = "latex"}) "\\doublespacing"]]
[[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}"]]]
,[Para [RawInline (Format "latex") "\\doublespacing"]]
,[Para [Math InlineMath "2+2=4"]]
,[Para [Math InlineMath "x \\in y"]]
,[Para [Math InlineMath "\\alpha \\wedge \\omega"]]

View file

@ -2,9 +2,9 @@
,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"]
,Plain [RawInline (Format {unFormat = "tex"}) "\\placeformula "]
,RawBlock (Format {unFormat = "context"}) "\\startformula\n L_{1} = L_{2}\n \\stopformula"
,RawBlock (Format {unFormat = "context"}) "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]"
,Plain [RawInline (Format "tex") "\\placeformula "]
,RawBlock (Format "context") "\\startformula\n L_{1} = L_{2}\n \\stopformula"
,RawBlock (Format "context") "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]"
,Header 2 ("urls-with-spaces",[],[]) [Str "URLs",Space,Str "with",Space,Str "spaces"]
,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")]
,Para [Link [Str "baz"] ("/foo%20foo",""),Space,Link [Str "bam"] ("/foo%20fee",""),Space,Link [Str "bork"] ("/foo/zee%20zob","title")]
@ -12,13 +12,13 @@
,HorizontalRule
,HorizontalRule
,Header 2 ("raw-html-before-header",[],[]) [Str "Raw",Space,Str "HTML",Space,Str "before",Space,Str "header"]
,Para [RawInline (Format {unFormat = "html"}) "<a>",RawInline (Format {unFormat = "html"}) "</a>"]
,Para [RawInline (Format "html") "<a>",RawInline (Format "html") "</a>"]
,Header 3 ("my-header",[],[]) [Str "my",Space,Str "header"]
,Header 2 ("in-math",[],[]) [Str "$",Space,Str "in",Space,Str "math"]
,Para [Math InlineMath "\\$2 + \\$3"]
,Header 2 ("commented-out-list-item",[],[]) [Str "Commented-out",Space,Str "list",Space,Str "item"]
,BulletList
[[Plain [Str "one",Space,RawInline (Format {unFormat = "html"}) "<!--\n- two\n-->"]]
[[Plain [Str "one",Space,RawInline (Format "html") "<!--\n- two\n-->"]]
,[Plain [Str "three"]]]
,Header 2 ("backslash-newline",[],[]) [Str "Backslash",Space,Str "newline"]
,Para [Str "hi",LineBreak,Str "there"]

View file

@ -1,4 +1,4 @@
Pandoc (Meta {unMeta = fromList []})
Pandoc (Meta (fromList []))
[Header 1 ("",[],[]) [Str "header"]
,Header 2 ("",[],[]) [Str "header",Space,Str "level",Space,Str "two"]
,Header 3 ("",[],[]) [Str "header",Space,Str "level",Space,Str "3"]
@ -51,11 +51,11 @@ Pandoc (Meta {unMeta = fromList []})
,Para [Str "bud"]
,Para [Str "another"]
,Header 2 ("",[],[]) [Str "raw",Space,Str "html"]
,Para [Str "hi",Space,RawInline (Format {unFormat = "html"}) "<span style=\"color:red\">",Emph [Str "there"],RawInline (Format {unFormat = "html"}) "</span>",Str "."]
,Para [RawInline (Format {unFormat = "html"}) "<ins>",Str "inserted",RawInline (Format {unFormat = "html"}) "</ins>"]
,RawBlock (Format {unFormat = "html"}) "<div class=\"special\">"
,Para [Str "hi",Space,RawInline (Format "html") "<span style=\"color:red\">",Emph [Str "there"],RawInline (Format "html") "</span>",Str "."]
,Para [RawInline (Format "html") "<ins>",Str "inserted",RawInline (Format "html") "</ins>"]
,RawBlock (Format "html") "<div class=\"special\">"
,Para [Str "hi",Space,Emph [Str "there"]]
,RawBlock (Format {unFormat = "html"}) "</div>"
,RawBlock (Format "html") "</div>"
,Header 2 ("",[],[]) [Str "sup,",Space,Str "sub,",Space,Str "del"]
,Para [Str "H",Subscript [Str "2"],Str "O",Space,Str "base",Superscript [Emph [Str "exponent"]],Space,Strikeout [Str "hello"]]
,Header 2 ("",[],[]) [Str "inline",Space,Str "code"]
@ -140,7 +140,7 @@ Pandoc (Meta {unMeta = fromList []})
,[Plain [Str "this",Space,Str "looks",Space,Str "like",Space,Str "a",Space,Str "continuation"]]
,[Plain [Str "and",Space,Str "is",Space,Str "often",Space,Str "used"]]
,[Plain [Str "instead",LineBreak,Str "of",Space,Str "<br/>"]]])]]
,[Plain [RawInline (Format {unFormat = "mediawiki"}) "{{{template\n|author=John\n|title=My Book\n}}}"]
,[Plain [RawInline (Format "mediawiki") "{{{template\n|author=John\n|title=My Book\n}}}"]
,OrderedList (1,DefaultStyle,DefaultDelim)
[[Plain [Str "five",Space,Str "sub",Space,Str "1"]
,OrderedList (1,DefaultStyle,DefaultDelim)
@ -168,16 +168,16 @@ Pandoc (Meta {unMeta = fromList []})
,Para [Code ("",[],[]) "\160hell\160\160\160\160\160\160yeah"]
,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"]
,Para [Str "Not"]
,RawBlock (Format {unFormat = "html"}) "<hr/>"
,RawBlock (Format "html") "<hr/>"
,Para [Str "preformatted"]
,Para [Str "Don't",Space,Str "need"]
,Para [Code ("",[],[]) "a\160blank\160line"]
,Para [Str "around",Space,Str "a",Space,Str "preformatted",Space,Str "block."]
,Header 2 ("",[],[]) [Str "templates"]
,RawBlock (Format {unFormat = "mediawiki"}) "{{Welcome}}"
,RawBlock (Format {unFormat = "mediawiki"}) "{{Foo:Bar}}"
,RawBlock (Format {unFormat = "mediawiki"}) "{{Thankyou|all your effort|Me}}"
,Para [Str "Written",Space,RawInline (Format {unFormat = "mediawiki"}) "{{{date}}}",Space,Str "by",Space,RawInline (Format {unFormat = "mediawiki"}) "{{{name}}}",Str "."]
,RawBlock (Format "mediawiki") "{{Welcome}}"
,RawBlock (Format "mediawiki") "{{Foo:Bar}}"
,RawBlock (Format "mediawiki") "{{Thankyou|all your effort|Me}}"
,Para [Str "Written",Space,RawInline (Format "mediawiki") "{{{date}}}",Space,Str "by",Space,RawInline (Format "mediawiki") "{{{name}}}",Str "."]
,Header 2 ("",[],[]) [Str "tables"]
,Table [] [AlignDefault,AlignDefault] [0.0,0.0]
[[]

View file

@ -1,4 +1,4 @@
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"])]})
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"])]))
[Header 1 ("",[],[]) [Str "United",Space,Str "States"]
,Header 2 ("",[],[]) [Str "Far",Space,Str "West"]
,Header 3 ("",[],[]) [Str "Alaska"]

View file

@ -1,4 +1,4 @@
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"])]})
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"])]))
[Header 1 ("",[],[]) [Str "Level",Space,Str "one",Space,Str "header"]
,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."]
,Header 2 ("",[],[]) [Str "Level",Space,Str "two",Space,Str "header"]
@ -172,11 +172,11 @@ Pandoc (Meta {unMeta = fromList [("authors",MetaList [MetaInlines [Str "John",Sp
[[Para [Str "123-4567"]]])]
,Header 1 ("",[],[]) [Str "HTML",Space,Str "Blocks"]
,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
,RawBlock (Format {unFormat = "html"}) "<div>foo</div>"
,RawBlock (Format "html") "<div>foo</div>"
,Para [Str "Now,",Space,Str "nested:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n <div>\n <div>\n foo\n </div>\n </div>\n</div>"
,RawBlock (Format "html") "<div>\n <div>\n <div>\n foo\n </div>\n </div>\n</div>"
,Header 1 ("",[],[]) [Str "LaTeX",Space,Str "Block"]
,RawBlock (Format {unFormat = "latex"}) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
,Header 1 ("",[],[]) [Str "Inline",Space,Str "Markup"]
,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ".",Space,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str "."]
,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 "."]

View file

@ -1,4 +1,4 @@
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"])]})
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"])]))
[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"]
,BulletList
[[Plain [Str "first",Space,Str "bullet"]]

View file

@ -1,4 +1,4 @@
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"])]})
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"])]))
[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."]
,HorizontalRule
,Header 1 ("headers",[],[]) [Str "Headers"]
@ -228,45 +228,45 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
,[Plain [Str "sublist"]]]]])]
,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"]
,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
,RawBlock (Format {unFormat = "html"}) "<div>"
,RawBlock (Format "html") "<div>"
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n"
,RawBlock (Format "html") "</div>\n"
,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n<div>\n<div>"
,RawBlock (Format "html") "<div>\n<div>\n<div>"
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n<div>"
,RawBlock (Format "html") "</div>\n</div>\n<div>"
,Plain [Str "bar"]
,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n"
,RawBlock (Format "html") "</div>\n</div>\n"
,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
,RawBlock (Format {unFormat = "html"}) "<table>\n<tr>\n<td>"
,RawBlock (Format "html") "<table>\n<tr>\n<td>"
,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
,RawBlock (Format {unFormat = "html"}) "</td>\n<td>"
,RawBlock (Format "html") "</td>\n<td>"
,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
,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"
,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"
,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n "
,RawBlock (Format "html") "<div>\n "
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n"
,RawBlock (Format "html") "</div>\n"
,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
,Para [Str "As",Space,Str "should",Space,Str "this:"]
,CodeBlock ("",[],[]) "<div>foo</div>"
,Para [Str "Now,",Space,Str "nested:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n <div>\n <div>\n "
,RawBlock (Format "html") "<div>\n <div>\n <div>\n "
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n </div>\n</div>\n"
,RawBlock (Format "html") "</div>\n </div>\n</div>\n"
,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
,RawBlock (Format {unFormat = "html"}) "<!-- Comment -->\n"
,RawBlock (Format "html") "<!-- Comment -->\n"
,Para [Str "Multiline:"]
,RawBlock (Format {unFormat = "html"}) "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
,RawBlock (Format "html") "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
,Para [Str "Code",Space,Str "block:"]
,CodeBlock ("",[],[]) "<!-- Comment -->"
,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:"]
,RawBlock (Format {unFormat = "html"}) "<!-- foo --> \n"
,RawBlock (Format "html") "<!-- foo --> \n"
,Para [Str "Code:"]
,CodeBlock ("",[],[]) "<hr />"
,Para [Str "Hr\8217s:"]
,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"
,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"
,HorizontalRule
,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"]
,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
,HorizontalRule
,Header 1 ("latex",[],[]) [Str "LaTeX"]
,BulletList
[[Plain [RawInline (Format {unFormat = "tex"}) "\\cite[22-23]{smith.1899}"]]
[[Plain [RawInline (Format "tex") "\\cite[22-23]{smith.1899}"]]
,[Plain [Math InlineMath "2+2=4"]]
,[Plain [Math InlineMath "x \\in y"]]
,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]]
@ -309,7 +309,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
,[Plain [Str "Shoes",Space,Str "($20)",Space,Str "and",Space,Str "socks",Space,Str "($5)."]]
,[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$."]]]
,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
,RawBlock (Format {unFormat = "latex"}) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
,HorizontalRule
,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"]
,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"]

View file

@ -1,4 +1,4 @@
Pandoc (Meta {unMeta = fromList []})
Pandoc (Meta (fromList []))
[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 "."]
,HorizontalRule
,Header 1 ("",[],[]) [Str "Headers"]
@ -137,23 +137,23 @@ Pandoc (Meta {unMeta = fromList []})
,Header 1 ("",[],[]) [Str "Entities"]
,Para [Str "*",LineBreak,Str "&"]
,Header 1 ("",[],[]) [Str "Raw",Space,Str "HTML"]
,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 ":"]
,RawBlock (Format {unFormat = "html"}) "<div class=\"foobar\">"
,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 ":"]
,RawBlock (Format "html") "<div class=\"foobar\">"
,Para [Str "any",Space,Strong [Str "Raw",Space,Str "HTML",Space,Str "Block"],Space,Str "with",Space,Str "bold"]
,RawBlock (Format {unFormat = "html"}) "</div>"
,RawBlock (Format "html") "</div>"
,Para [Str "Html",Space,Str "blocks",Space,Str "can",Space,Str "be"]
,RawBlock (Format {unFormat = "html"}) "<div>"
,RawBlock (Format "html") "<div>"
,Para [Str "inlined"]
,RawBlock (Format {unFormat = "html"}) "</div>"
,RawBlock (Format "html") "</div>"
,Para [Str "as",Space,Str "well",Str "."]
,BulletList
[[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 ">"]]
,[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>"]]]
,[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>"]]]
,Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"]
,Header 1 ("",[],[]) [Str "Raw",Space,Str "LaTeX"]
,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 ":"]
,RawBlock (Format {unFormat = "latex"}) "\\begin{itemize}\n \\item one\n \\item two\n\\end{itemize}"
,Para [Str "and",Space,Str "for",Space,RawInline (Format {unFormat = "latex"}) "\\emph{inlines}",Str "."]
,RawBlock (Format "latex") "\\begin{itemize}\n \\item one\n \\item two\n\\end{itemize}"
,Para [Str "and",Space,Str "for",Space,RawInline (Format "latex") "\\emph{inlines}",Str "."]
,Header 1 ("",[],[]) [Str "Acronyms",Space,Str "and",Space,Str "marks"]
,Para [Str "PBS (Public Broadcasting System)"]
,Para [Str "Hi",Str "\8482"]

View file

@ -1,4 +1,4 @@
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"])]})
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"])]))
[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."]
,HorizontalRule
,Header 1 ("headers",[],[]) [Str "Headers"]
@ -228,45 +228,45 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
,[Plain [Str "sublist"]]]]])]
,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"]
,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
,RawBlock (Format {unFormat = "html"}) "<div>"
,RawBlock (Format "html") "<div>"
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n"
,RawBlock (Format "html") "</div>\n"
,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n<div>\n<div>"
,RawBlock (Format "html") "<div>\n<div>\n<div>"
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n<div>"
,RawBlock (Format "html") "</div>\n</div>\n<div>"
,Plain [Str "bar"]
,RawBlock (Format {unFormat = "html"}) "</div>\n</div>\n"
,RawBlock (Format "html") "</div>\n</div>\n"
,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
,RawBlock (Format {unFormat = "html"}) "<table>\n<tr>\n<td>"
,RawBlock (Format "html") "<table>\n<tr>\n<td>"
,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
,RawBlock (Format {unFormat = "html"}) "</td>\n<td>"
,RawBlock (Format "html") "</td>\n<td>"
,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
,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"
,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"
,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n "
,RawBlock (Format "html") "<div>\n "
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n"
,RawBlock (Format "html") "</div>\n"
,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
,Para [Str "As",Space,Str "should",Space,Str "this:"]
,CodeBlock ("",[],[]) "<div>foo</div>"
,Para [Str "Now,",Space,Str "nested:"]
,RawBlock (Format {unFormat = "html"}) "<div>\n <div>\n <div>\n "
,RawBlock (Format "html") "<div>\n <div>\n <div>\n "
,Plain [Str "foo"]
,RawBlock (Format {unFormat = "html"}) "</div>\n </div>\n</div>\n"
,RawBlock (Format "html") "</div>\n </div>\n</div>\n"
,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
,RawBlock (Format {unFormat = "html"}) "<!-- Comment -->\n"
,RawBlock (Format "html") "<!-- Comment -->\n"
,Para [Str "Multiline:"]
,RawBlock (Format {unFormat = "html"}) "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
,RawBlock (Format "html") "<!--\nBlah\nBlah\n-->\n\n<!--\n This is another comment.\n-->\n"
,Para [Str "Code",Space,Str "block:"]
,CodeBlock ("",[],[]) "<!-- Comment -->"
,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:"]
,RawBlock (Format {unFormat = "html"}) "<!-- foo --> \n"
,RawBlock (Format "html") "<!-- foo --> \n"
,Para [Str "Code:"]
,CodeBlock ("",[],[]) "<hr />"
,Para [Str "Hr\8217s:"]
,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"
,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"
,HorizontalRule
,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"]
,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
,HorizontalRule
,Header 1 ("latex",[],[]) [Str "LaTeX"]
,BulletList
[[Plain [RawInline (Format {unFormat = "tex"}) "\\cite[22-23]{smith.1899}"]]
[[Plain [RawInline (Format "tex") "\\cite[22-23]{smith.1899}"]]
,[Plain [Math InlineMath "2+2=4"]]
,[Plain [Math InlineMath "x \\in y"]]
,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]]
@ -309,7 +309,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
,[Plain [Str "Shoes",Space,Str "($20)",Space,Str "and",Space,Str "socks",Space,Str "($5)."]]
,[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$."]]]
,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
,RawBlock (Format {unFormat = "latex"}) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"
,HorizontalRule
,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"]
,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"]