diff options
author | leungbk <bkleung89@gmail.com> | 2018-09-27 15:04:56 -0700 |
---|---|---|
committer | Albert Krewinkel <albert+github@zeitkraut.de> | 2018-09-28 14:05:14 +0200 |
commit | 4f9ab7e03268e576d86e697f7110869434d08557 (patch) | |
tree | 75a505afe73184486dec342eb00c82704144428e /src/Text/Pandoc/Readers/Org/Inlines.hs | |
parent | c07b9aebc2bc7e95da7a6feab26ce14e2e5f4a0e (diff) | |
download | pandoc-4f9ab7e03268e576d86e697f7110869434d08557.tar.gz |
Parse empty argument array in inline src blocks.
`enclosedByPair` alone does not the handle the empty array properly since it uses `many1Till`.
Diffstat (limited to 'src/Text/Pandoc/Readers/Org/Inlines.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Inlines.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs index b9a589f03..a5335ca57 100644 --- a/src/Text/Pandoc/Readers/Org/Inlines.hs +++ b/src/Text/Pandoc/Readers/Org/Inlines.hs @@ -525,7 +525,8 @@ inlineCodeBlock :: PandocMonad m => OrgParser m (F Inlines) inlineCodeBlock = try $ do string "src_" lang <- many1 orgArgWordChar - opts <- option [] $ enclosedByPair '[' ']' inlineBlockOption + opts <- option [] $ try (enclosedByPair '[' ']' inlineBlockOption) + <|> (mempty <$ string "[]") inlineCode <- enclosedByPair '{' '}' (noneOf "\n\r") let attrClasses = [translateLang lang] let attrKeyVal = originalLang lang <> opts |