diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-04-26 13:04:28 +0300 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-04-26 12:04:28 +0200 |
commit | 256e3a6a5d3f91262e8b3304fc2fa8cd1a854038 (patch) | |
tree | 8386883d90a4ea98317bc829086facd78e058845 | |
parent | 81548960d52d6c3ca34aa5fa041e5aa8bae9481b (diff) | |
download | pandoc-256e3a6a5d3f91262e8b3304fc2fa8cd1a854038.tar.gz |
Simplify linkText in Text.Pandoc.Readers.TWiki (#3605)
Avoid constructing list of one element ([B.str url]) just to flatten it
back with mconcat.
-rw-r--r-- | src/Text/Pandoc/Readers/TWiki.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/TWiki.hs b/src/Text/Pandoc/Readers/TWiki.hs index 0d8ff383e..ecb609ae9 100644 --- a/src/Text/Pandoc/Readers/TWiki.hs +++ b/src/Text/Pandoc/Readers/TWiki.hs @@ -520,9 +520,9 @@ linkText :: PandocMonad m => TWParser m (String, String, B.Inlines) linkText = do string "[[" url <- many1Till anyChar (char ']') - content <- option [B.str url] linkContent + content <- option (B.str url) (mconcat <$> linkContent) char ']' - return (url, "", mconcat content) + return (url, "", content) where linkContent = (char '[') >> many1Till anyChar (char ']') >>= parseLinkContent parseLinkContent = parseFromString $ many1 inline |