Native writer: eliminated empty spaces in brackets.
This commit is contained in:
parent
6b50778b2a
commit
8011d079c8
1 changed files with 3 additions and 2 deletions
|
@ -37,7 +37,7 @@ import Text.Pandoc.Pretty
|
||||||
|
|
||||||
prettyList :: [Doc] -> Doc
|
prettyList :: [Doc] -> Doc
|
||||||
prettyList ds =
|
prettyList ds =
|
||||||
"[ " <> (cat $ intersperse (cr <> ", ") $ map (nest 2) ds) <> " ]"
|
"[" <> (cat $ intersperse (cr <> ",") $ map (nest 1) ds) <> "]"
|
||||||
|
|
||||||
-- | Prettyprint Pandoc block element.
|
-- | Prettyprint Pandoc block element.
|
||||||
prettyBlock :: Block -> Doc
|
prettyBlock :: Block -> Doc
|
||||||
|
@ -55,7 +55,8 @@ prettyBlock (DefinitionList items) = "DefinitionList" $$
|
||||||
nest 1 (prettyList $ map (prettyList . map prettyBlock) defs) <> ")"
|
nest 1 (prettyList $ map (prettyList . map prettyBlock) defs) <> ")"
|
||||||
prettyBlock (Table caption aligns widths header rows) =
|
prettyBlock (Table caption aligns widths header rows) =
|
||||||
"Table " <> text (show caption) <> " " <> text (show aligns) <> " " <>
|
"Table " <> text (show caption) <> " " <> text (show aligns) <> " " <>
|
||||||
text (show widths) $$ nest 2 (prettyRow header) <>
|
text (show widths) $$
|
||||||
|
prettyRow header $$
|
||||||
prettyList (map prettyRow rows)
|
prettyList (map prettyRow rows)
|
||||||
where prettyRow cols = prettyList (map (prettyList . map prettyBlock) cols)
|
where prettyRow cols = prettyList (map (prettyList . map prettyBlock) cols)
|
||||||
prettyBlock block = text $ show block
|
prettyBlock block = text $ show block
|
||||||
|
|
Loading…
Reference in a new issue