pandoc/tests/tables.native
John MacFarlane fadc7b0d87 Major rewrite of markdown reader.
* Use Builder's Inlines/Blocks instead of lists.

* Return values in the reader monad, which are then
  run (at the end of parsing) against the final
  parser state.  This allows links, notes, and
  example numbers to be resolved without a second
  parser pass.

* An effect of using Builder is that everything is
  normalized automatically.

* New exports from Text.Pandoc.Parsing:
  widthsFromIndices, NoteTable', KeyTable', Key', toKey',
  withQuoteContext, singleQuoteStart, singleQuoteEnd, doubleQuoteStart,
  doubleQuoteEnd, ellipses, apostrophe, dash

* Updated opendocument tests.

* Don't derive Show for ParserState.

* Benchmarks:  markdown reader takes 82% of the time it took before.
  Markdown writer takes 92% of the time (here the speedup is probably
  due to the fact that everything is normalized by default).
2012-08-01 21:45:40 -07:00

114 lines
4.5 KiB
Text

[Para [Str "Simple",Space,Str "table",Space,Str "with",Space,Str "caption:"]
,Table [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] [AlignRight,AlignLeft,AlignCenter,AlignDefault] [0.0,0.0,0.0,0.0]
[[Plain [Str "Right"]]
,[Plain [Str "Left"]]
,[Plain [Str "Center"]]
,[Plain [Str "Default"]]]
[[[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]]
,[[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]]
,[[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]]]
,Para [Str "Simple",Space,Str "table",Space,Str "without",Space,Str "caption:"]
,Table [] [AlignRight,AlignLeft,AlignCenter,AlignDefault] [0.0,0.0,0.0,0.0]
[[Plain [Str "Right"]]
,[Plain [Str "Left"]]
,[Plain [Str "Center"]]
,[Plain [Str "Default"]]]
[[[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]]
,[[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]]
,[[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]]]
,Para [Str "Simple",Space,Str "table",Space,Str "indented",Space,Str "two",Space,Str "spaces:"]
,Table [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] [AlignRight,AlignLeft,AlignCenter,AlignDefault] [0.0,0.0,0.0,0.0]
[[Plain [Str "Right"]]
,[Plain [Str "Left"]]
,[Plain [Str "Center"]]
,[Plain [Str "Default"]]]
[[[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]]
,[[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]]
,[[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]]]
,Para [Str "Multiline",Space,Str "table",Space,Str "with",Space,Str "caption:"]
,Table [Str "Here's",Space,Str "the",Space,Str "caption.",Space,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] [AlignCenter,AlignLeft,AlignRight,AlignLeft] [0.15,0.1375,0.1625,0.3375]
[[Plain [Str "Centered",Space,Str "Header"]]
,[Plain [Str "Left",Space,Str "Aligned"]]
,[Plain [Str "Right",Space,Str "Aligned"]]
,[Plain [Str "Default",Space,Str "aligned"]]]
[[[Plain [Str "First"]]
,[Plain [Str "row"]]
,[Plain [Str "12.0"]]
,[Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",Space,Str "multiple",Space,Str "lines."]]]
,[[Plain [Str "Second"]]
,[Plain [Str "row"]]
,[Plain [Str "5.0"]]
,[Plain [Str "Here's",Space,Str "another",Space,Str "one.",Space,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]]
,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "caption:"]
,Table [] [AlignCenter,AlignLeft,AlignRight,AlignLeft] [0.15,0.1375,0.1625,0.3375]
[[Plain [Str "Centered",Space,Str "Header"]]
,[Plain [Str "Left",Space,Str "Aligned"]]
,[Plain [Str "Right",Space,Str "Aligned"]]
,[Plain [Str "Default",Space,Str "aligned"]]]
[[[Plain [Str "First"]]
,[Plain [Str "row"]]
,[Plain [Str "12.0"]]
,[Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",Space,Str "multiple",Space,Str "lines."]]]
,[[Plain [Str "Second"]]
,[Plain [Str "row"]]
,[Plain [Str "5.0"]]
,[Plain [Str "Here's",Space,Str "another",Space,Str "one.",Space,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]]
,Para [Str "Table",Space,Str "without",Space,Str "column",Space,Str "headers:"]
,Table [] [AlignRight,AlignLeft,AlignCenter,AlignRight] [0.0,0.0,0.0,0.0]
[[]
,[]
,[]
,[]]
[[[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]
,[Plain [Str "12"]]]
,[[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]
,[Plain [Str "123"]]]
,[[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]
,[Plain [Str "1"]]]]
,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "column",Space,Str "headers:"]
,Table [] [AlignCenter,AlignLeft,AlignRight,AlignDefault] [0.15,0.1375,0.1625,0.3375]
[[]
,[]
,[]
,[]]
[[[Plain [Str "First"]]
,[Plain [Str "row"]]
,[Plain [Str "12.0"]]
,[Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",Space,Str "multiple",Space,Str "lines."]]]
,[[Plain [Str "Second"]]
,[Plain [Str "row"]]
,[Plain [Str "5.0"]]
,[Plain [Str "Here's",Space,Str "another",Space,Str "one.",Space,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]]]