diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-02-11 22:36:47 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-02-11 22:37:07 +0100 |
commit | 27599602042a43bfe1506c008dab862352bba0b1 (patch) | |
tree | 75a5fcbb9dddff3e9595a9baef04a78ea08cd763 /test | |
parent | 510a6ee059cd99bef41102f754c0e4674493f28f (diff) | |
download | pandoc-27599602042a43bfe1506c008dab862352bba0b1.tar.gz |
RST reader/writer: properly handle table captions.
Currently the support for the `.. table` directive is a bit
limited; we don't yet support the `widths` field. But at least
you can have a proper captioned table.
Diffstat (limited to 'test')
-rw-r--r-- | test/tables-rstsubset.native | 9 | ||||
-rw-r--r-- | test/tables.rst | 68 |
2 files changed, 37 insertions, 40 deletions
diff --git a/test/tables-rstsubset.native b/test/tables-rstsubset.native index ecf6911dc..65ced24af 100644 --- a/test/tables-rstsubset.native +++ b/test/tables-rstsubset.native @@ -1,5 +1,5 @@ [Para [Str "Simple",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.125,0.1125,0.1375,0.15] +,Table [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.125,0.1125,0.1375,0.15] [[Plain [Str "Right"]] ,[Plain [Str "Left"]] ,[Plain [Str "Center"]] @@ -16,7 +16,6 @@ ,[Plain [Str "1"]] ,[Plain [Str "1"]] ,[Plain [Str "1"]]]] -,Para [Str "Table:",Space,Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] ,Para [Str "Simple",Space,Str "table",Space,Str "without",Space,Str "caption:"] ,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.125,0.1125,0.1375,0.15] [[Plain [Str "Right"]] @@ -36,7 +35,7 @@ ,[Plain [Str "1"]] ,[Plain [Str "1"]]]] ,Para [Str "Simple",Space,Str "table",Space,Str "indented",Space,Str "two",Space,Str "spaces:"] -,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.125,0.1125,0.1375,0.15] +,Table [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.125,0.1125,0.1375,0.15] [[Plain [Str "Right"]] ,[Plain [Str "Left"]] ,[Plain [Str "Center"]] @@ -53,9 +52,8 @@ ,[Plain [Str "1"]] ,[Plain [Str "1"]] ,[Plain [Str "1"]]]] -,Para [Str "Table:",Space,Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."] ,Para [Str "Multiline",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.175,0.1625,0.1875,0.3625] +,Table [Str "Here\8217s",Space,Str "the",Space,Str "caption.",Space,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.175,0.1625,0.1875,0.3625] [[Plain [Str "Centered",Space,Str "Header"]] ,[Plain [Str "Left",Space,Str "Aligned"]] ,[Plain [Str "Right",Space,Str "Aligned"]] @@ -68,7 +66,6 @@ ,[Plain [Str "row"]] ,[Plain [Str "5.0"]] ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]] -,Para [Str "Table:",Space,Str "Here\8217s",Space,Str "the",Space,Str "caption.",Space,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] ,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "caption:"] ,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.175,0.1625,0.1875,0.3625] [[Plain [Str "Centered",Space,Str "Header"]] diff --git a/test/tables.rst b/test/tables.rst index fc7f0b475..184d9894a 100644 --- a/test/tables.rst +++ b/test/tables.rst @@ -1,16 +1,16 @@ Simple table with caption: -+---------+--------+----------+-----------+ -| Right | Left | Center | Default | -+=========+========+==========+===========+ -| 12 | 12 | 12 | 12 | -+---------+--------+----------+-----------+ -| 123 | 123 | 123 | 123 | -+---------+--------+----------+-----------+ -| 1 | 1 | 1 | 1 | -+---------+--------+----------+-----------+ - -Table: Demonstration of simple table syntax. +.. table:: Demonstration of simple table syntax. + + +---------+--------+----------+-----------+ + | Right | Left | Center | Default | + +=========+========+==========+===========+ + | 12 | 12 | 12 | 12 | + +---------+--------+----------+-----------+ + | 123 | 123 | 123 | 123 | + +---------+--------+----------+-----------+ + | 1 | 1 | 1 | 1 | + +---------+--------+----------+-----------+ Simple table without caption: @@ -26,33 +26,33 @@ Simple table without caption: Simple table indented two spaces: -+---------+--------+----------+-----------+ -| Right | Left | Center | Default | -+=========+========+==========+===========+ -| 12 | 12 | 12 | 12 | -+---------+--------+----------+-----------+ -| 123 | 123 | 123 | 123 | -+---------+--------+----------+-----------+ -| 1 | 1 | 1 | 1 | -+---------+--------+----------+-----------+ +.. table:: Demonstration of simple table syntax. -Table: Demonstration of simple table syntax. + +---------+--------+----------+-----------+ + | Right | Left | Center | Default | + +=========+========+==========+===========+ + | 12 | 12 | 12 | 12 | + +---------+--------+----------+-----------+ + | 123 | 123 | 123 | 123 | + +---------+--------+----------+-----------+ + | 1 | 1 | 1 | 1 | + +---------+--------+----------+-----------+ Multiline table with caption: -+-------------+------------+--------------+----------------------------+ -| Centered | Left | Right | Default aligned | -| Header | Aligned | Aligned | | -+=============+============+==============+============================+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+-------------+------------+--------------+----------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+-------------+------------+--------------+----------------------------+ - -Table: Here’s the caption. It may span multiple lines. +.. table:: Here’s the caption. It may span multiple lines. + + +-------------+------------+--------------+----------------------------+ + | Centered | Left | Right | Default aligned | + | Header | Aligned | Aligned | | + +=============+============+==============+============================+ + | First | row | 12.0 | Example of a row that | + | | | | spans multiple lines. | + +-------------+------------+--------------+----------------------------+ + | Second | row | 5.0 | Here’s another one. Note | + | | | | the blank line between | + | | | | rows. | + +-------------+------------+--------------+----------------------------+ Multiline table without caption: |