From 374bb3c14785b77771d96319301ed5aef31089c5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Aug 2014 21:24:33 -0700 Subject: DokuWiki writer: Make tables prettier by aligning columns. Also cleaned up crufty code and added tests. --- tests/dokuwiki_multiblock_table.dokuwiki | 6 ++--- tests/tables.dokuwiki | 46 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'tests') diff --git a/tests/dokuwiki_multiblock_table.dokuwiki b/tests/dokuwiki_multiblock_table.dokuwiki index 9004b8aee..8b913f1f2 100644 --- a/tests/dokuwiki_multiblock_table.dokuwiki +++ b/tests/dokuwiki_multiblock_table.dokuwiki @@ -1,4 +1,4 @@ Sample grid table. -^ Fruit ^ Price ^ Advantages ^ -| Bananas | $1.34 | built-in wrapper\\ \\ potassium | -| Oranges | $2.10 | * cures scurvy\\ * tasty | +^Fruit ^Price^Advantages ^ +|Bananas|$1.34|built-in wrapper\\ \\ potassium| +|Oranges|$2.10|* cures scurvy\\ * tasty | diff --git a/tests/tables.dokuwiki b/tests/tables.dokuwiki index 4fcae4e6f..21e61f656 100644 --- a/tests/tables.dokuwiki +++ b/tests/tables.dokuwiki @@ -1,47 +1,47 @@ Simple table with caption: Demonstration of simple table syntax. -^ Right ^ Left ^ Center ^ Default ^ -| 12 | 12 | 12 | 12 | -| 123 | 123 | 123 | 123 | -| 1 | 1 | 1 | 1 | +^ Right^Left ^ Center ^Default^ +| 12|12 | 12 |12 | +| 123|123 | 123 |123 | +| 1|1 | 1 |1 | Simple table without caption: -^ Right ^ Left ^ Center ^ Default ^ -| 12 | 12 | 12 | 12 | -| 123 | 123 | 123 | 123 | -| 1 | 1 | 1 | 1 | +^ Right^Left ^ Center ^Default^ +| 12|12 | 12 |12 | +| 123|123 | 123 |123 | +| 1|1 | 1 |1 | Simple table indented two spaces: Demonstration of simple table syntax. -^ Right ^ Left ^ Center ^ Default ^ -| 12 | 12 | 12 | 12 | -| 123 | 123 | 123 | 123 | -| 1 | 1 | 1 | 1 | +^ Right^Left ^ Center ^Default^ +| 12|12 | 12 |12 | +| 123|123 | 123 |123 | +| 1|1 | 1 |1 | Multiline table with caption: Here's the caption. It may span multiple lines. -^ Centered Header ^ Left Aligned ^ Right Aligned ^ Default 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. | +^ Centered Header ^Left Aligned ^ Right Aligned^Default 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: -^ Centered Header ^ Left Aligned ^ Right Aligned ^ Default 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. | +^ Centered Header ^Left Aligned ^ Right Aligned^Default 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 without column headers: -| 12 | 12 | 12 | 12 | -| 123 | 123 | 123 | 123 | -| 1 | 1 | 1 | 1 | +| 12|12 | 12 | 12| +| 123|123 | 123 | 123| +| 1|1 | 1 | 1| Multiline table without column headers: -| 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. | +| 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.| -- cgit v1.2.3