git.iko.soy/typeable/pandoc
on master help sign in
Text.Pandoc.Blocks:

+ Fixed a bug in hPad, which previously padded the rightmost cell. This is fixed by introducing a case for a singleton list. + Fixed Markdown writer so that the space after a table is not nested two spaces. + Adjusted Markdown table tests accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@660 788f1e2b-df1e-0410-8736-df70ead52e1b

commit69072efc004f656c4da831a170e45516dd3f287c authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 9 Jul 2007, 01:36 (19 years ago) parent0ceb538
3 files changed+32−31
src/Text/Pandoc/Blocks.hs+1 src/Text/Pandoc/Writers/Markdown.hs+2−2 tests/tables.markdown+29−29
src/Text/Pandoc/Blocks.hs+1
@@ -97,6 +97,7 @@ hPad width line =
9797-- which they appear side by side.
9898hcatBlocks :: [TextBlock] -> TextBlock
9999hcatBlocks [] = TextBlock 0 0 []
100+hcatBlocks [x] = x -- This is not redundant! We don't want last item hPad'd.
100101hcatBlocks ((TextBlock width1 height1 lns1):xs) =
101102 let (TextBlock width2 height2 lns2) = hcatBlocks xs
102103 height = max height1 height2
src/Text/Pandoc/Writers/Markdown.hs+2−2
@@ -205,8 +205,8 @@ blockToMarkdown opts (Table caption aligns widths headers rows) = do
205205 then text ""
206206 else empty
207207 let body = vcat $ intersperse spacer $ map blockToDoc rows'
208− return $ nest 2 $ border $$ (blockToDoc head) $$ underline $$ body $$
209− border $$ caption'' $$ text ""
208+ return $ (nest 2 $ border $$ (blockToDoc head) $$ underline $$ body $$
209+ border $$ caption'') $$ text ""
210210blockToMarkdown opts (BulletList items) = do
211211 contents <- mapM (bulletListItemToMarkdown opts) items
212212 return $ (vcat contents) <> text "\n"
tests/tables.markdown+29−29
@@ -1,59 +1,59 @@
11Simple table with caption:
22
3− Right Left Center Default
3+ Right Left Center Default
44 ----------- ------ ------------ ---------
5− 12 12 12 12
6− 123 123 123 123
7− 1 1 1 1
5+ 12 12 12 12
6+ 123 123 123 123
7+ 1 1 1 1
88
99 Table: Demonstration of simple table syntax.
10−
10+
1111Simple table without caption:
1212
13− Right Left Center Default
13+ Right Left Center Default
1414 ----------- ------ ------------ ---------
15− 12 12 12 12
16− 123 123 123 123
17− 1 1 1 1
18−
15+ 12 12 12 12
16+ 123 123 123 123
17+ 1 1 1 1
18+
1919Simple table indented two spaces:
2020
21− Right Left Center Default
21+ Right Left Center Default
2222 ----------- ------ ------------ ---------
23− 12 12 12 12
24− 123 123 123 123
25− 1 1 1 1
23+ 12 12 12 12
24+ 123 123 123 123
25+ 1 1 1 1
2626
2727 Table: Demonstration of simple table syntax.
28−
28+
2929Multiline table with caption:
3030
3131 --------------------------------------------------------------
32− Centered Left Right Default aligned
32+ Centered Left Right Default aligned
3333 Header Aligned Aligned
3434 ----------- ---------- ------------ --------------------------
35− First row 12.0 Example of a row that
36− spans multiple lines.
35+ First row 12.0 Example of a row that
36+ spans multiple lines.
3737
38− Second row 5.0 Here's another one. Note
39− the blank line between
40− rows.
38+ Second row 5.0 Here's another one. Note
39+ the blank line between
40+ rows.
4141 --------------------------------------------------------------
4242
4343 Table: Here's the caption. It may span multiple lines.
44−
44+
4545Multiline table without caption:
4646
4747 --------------------------------------------------------------
48− Centered Left Right Default aligned
48+ Centered Left Right Default aligned
4949 Header Aligned Aligned
5050 ----------- ---------- ------------ --------------------------
51− First row 12.0 Example of a row that
52− spans multiple lines.
51+ First row 12.0 Example of a row that
52+ spans multiple lines.
5353
54− Second row 5.0 Here's another one. Note
55− the blank line between
56− rows.
54+ Second row 5.0 Here's another one. Note
55+ the blank line between
56+ rows.
5757 --------------------------------------------------------------
58−
58+
5959