summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org/Blocks.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-11-19 01:17:04 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2016-11-19 01:17:04 +0100
commit1a8af5fc442287ef2f7775c4de179e4520487a4f (patch)
tree245e411f22c70ceb5e4076efb021fb16cf886510 /src/Text/Pandoc/Readers/Org/Blocks.hs
parentf9df62c29fc88634f1d4f264f894265096b0985f (diff)
Org reader: Ensure images in paragraphs are not parsed as figures
This fixes a regression introduced in 7e5220b57c5a48fabe6e43ba270db812593d3463.
Diffstat (limited to 'src/Text/Pandoc/Readers/Org/Blocks.hs')
-rw-r--r--src/Text/Pandoc/Readers/Org/Blocks.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs
index 481684600..807cce2fc 100644
--- a/src/Text/Pandoc/Readers/Org/Blocks.hs
+++ b/src/Text/Pandoc/Readers/Org/Blocks.hs
@@ -623,7 +623,7 @@ propertiesDrawer = try $ do
figure :: OrgParser (F Blocks)
figure = try $ do
figAttrs <- blockAttributes
- src <- skipSpaces *> selfTarget <* skipSpaces <* newline
+ src <- skipSpaces *> selfTarget <* skipSpaces <* endOfParagraph
case cleanLinkString src of
Nothing -> mzero
Just imgSrc -> do
@@ -652,6 +652,10 @@ figure = try $ do
then cs
else "fig:" ++ cs
+-- | Succeeds if looking at the end of the current paragraph
+endOfParagraph :: OrgParser ()
+endOfParagraph = try $ skipSpaces *> newline *> endOfBlock
+
--
-- Examples