aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org/Blocks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/Org/Blocks.hs')
-rw-r--r--src/Text/Pandoc/Readers/Org/Blocks.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs
index 82c3a6cbe..61978f79f 100644
--- a/src/Text/Pandoc/Readers/Org/Blocks.hs
+++ b/src/Text/Pandoc/Readers/Org/Blocks.hs
@@ -50,7 +50,7 @@ import Text.Pandoc.Shared ( compactify', compactify'DL )
import Control.Monad ( foldM, guard, mzero, void )
import Data.Char ( isSpace, toLower, toUpper)
-import Data.List ( foldl', intersperse, isPrefixOf )
+import Data.List ( foldl', isPrefixOf )
import Data.Maybe ( fromMaybe, isNothing )
import Data.Monoid ((<>))
@@ -288,9 +288,9 @@ blockAttributes = try $ do
let kvAttrs = foldl' (appendValues "ATTR_HTML") Nothing kv
let name = lookup "NAME" kv
let label = lookup "LABEL" kv
- caption' <- maybe (return Nothing)
- (fmap Just . parseFromString inlines)
- caption
+ caption' <- case caption of
+ Nothing -> return Nothing
+ Just s -> Just <$> parseFromString inlines (s ++ "\n")
kvAttrs' <- parseFromString keyValues . (++ "\n") $ fromMaybe mempty kvAttrs
return $ BlockAttributes
{ blockAttrName = name
@@ -427,7 +427,7 @@ verseBlock :: String -> OrgParser (F Blocks)
verseBlock blockType = try $ do
ignHeaders
content <- rawBlockContent blockType
- fmap B.para . mconcat . intersperse (pure B.linebreak)
+ fmap B.lineBlock . sequence
<$> mapM parseVerseLine (lines content)
where
-- replace initial spaces with nonbreaking spaces to preserve