summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-08 14:00:13 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-08 14:00:13 -0700
commit1ad9679dc9147a778d272003c868d4d4f638fd31 (patch)
treef5c2458b20fcf4b371ab0d9023000a068f920bef
parent3752298d917f101ac0279b7fc057c38d765f1770 (diff)
CommonMark writer: avoid excess blank lines at end of output.
-rw-r--r--src/Text/Pandoc/Writers/CommonMark.hs2
-rw-r--r--test/command/gfm.md8
2 files changed, 1 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs
index 20a22e051..77562ed8a 100644
--- a/src/Text/Pandoc/Writers/CommonMark.hs
+++ b/src/Text/Pandoc/Writers/CommonMark.hs
@@ -86,7 +86,7 @@ blocksToCommonMark opts bs = do
then Just $ writerColumns opts
else Nothing
nodes <- blocksToNodes opts bs
- return $
+ return $ T.stripEnd $
nodeToCommonmark cmarkOpts colwidth $
node DOCUMENT nodes
diff --git a/test/command/gfm.md b/test/command/gfm.md
index 6dd080dc1..670f3cd6e 100644
--- a/test/command/gfm.md
+++ b/test/command/gfm.md
@@ -71,8 +71,6 @@ My:thumbsup:emoji:heart:
| orange | 1.12 |
The caption.
-
-
```
```
@@ -80,8 +78,6 @@ The caption.
“hi”
^D
"hi"
-
-
```
```
@@ -89,8 +85,6 @@ The caption.
"hi"
^D
“hi”
-
-
```
```
@@ -98,8 +92,6 @@ The caption.
"hi"
^D
"hi"
-
-
```
```