git.iko.soy/typeable/pandoc
on master help sign in
TWiki reader: hlint
05d52ebAlexander Krotov
src/Text/Pandoc/Readers/TWiki.hs+50−61
@@ -74,9 +74,6 @@ type TWParser = ParserT [Char] ParserState
74tryMsg :: String -> TWParser m a -> TWParser m a
74tryMsg :: String -> TWParser m a -> TWParser m a
75tryMsg msg p = try p <?> msg
75tryMsg msg p = try p <?> msg
76
76
77−skip :: TWParser m a -> TWParser m ()
78−skip parser = parser >> return ()
79−
80nested :: PandocMonad m => TWParser m a -> TWParser m a
77nested :: PandocMonad m => TWParser m a -> TWParser m a
81nested p = do
78nested p = do
82 nestlevel <- stateMaxNestingLevel <$> getState
79 nestlevel <- stateMaxNestingLevel <$> getState
@@ -92,7 +89,7 @@ htmlElement tag = tryMsg tag $ do
92 content <- manyTill anyChar (endtag <|> endofinput)
89 content <- manyTill anyChar (endtag <|> endofinput)
93 return (htmlAttrToPandoc attr, trim content)
90 return (htmlAttrToPandoc attr, trim content)
94 where
91 where
95− endtag = skip $ htmlTag (~== TagClose tag)
92+ endtag = void $ htmlTag (~== TagClose tag)
96 endofinput = lookAhead $ try $ skipMany blankline >> skipSpaces >> eof
93 endofinput = lookAhead $ try $ skipMany blankline >> skipSpaces >> eof
97 trim = dropWhile (=='\n') . reverse . dropWhile (=='\n') . reverse
94 trim = dropWhile (=='\n') . reverse . dropWhile (=='\n') . reverse
98
95
@@ -114,18 +111,15 @@ parseHtmlContentWithAttrs tag parser = do
114 endOfContent = try $ skipMany blankline >> skipSpaces >> eof
111 endOfContent = try $ skipMany blankline >> skipSpaces >> eof
115
112
116parseHtmlContent :: PandocMonad m => String -> TWParser m a -> TWParser m [a]
113parseHtmlContent :: PandocMonad m => String -> TWParser m a -> TWParser m [a]
117−parseHtmlContent tag p = parseHtmlContentWithAttrs tag p >>= return . snd
114+parseHtmlContent tag p = snd <$> parseHtmlContentWithAttrs tag p
118
115
119--
116--
120-- main parser
117-- main parser
121--
118--
122
119
123parseTWiki :: PandocMonad m => TWParser m Pandoc
120parseTWiki :: PandocMonad m => TWParser m Pandoc
124−parseTWiki = do
121+parseTWiki =
125− bs <- mconcat <$> many block
122+ B.doc . mconcat <$> many block <* spaces <* eof
126− spaces
127− eof
128− return $ B.doc bs
129
123
130
124
131--
125--
@@ -158,7 +152,7 @@ separator = tryMsg "separator" $ string "---" >> newline >> return B.horizontalR
158header :: PandocMonad m => TWParser m B.Blocks
152header :: PandocMonad m => TWParser m B.Blocks
159header = tryMsg "header" $ do
153header = tryMsg "header" $ do
160 string "---"
154 string "---"
161− level <- many1 (char '+') >>= return . length
155+ level <- length <$> many1 (char '+')
162 guard $ level <= 6
156 guard $ level <= 6
163 classes <- option [] $ string "!!" >> return ["unnumbered"]
157 classes <- option [] $ string "!!" >> return ["unnumbered"]
164 skipSpaces
158 skipSpaces
@@ -167,11 +161,10 @@ header = tryMsg "header" $ do
167 return $ B.headerWith attr level content
161 return $ B.headerWith attr level content
168
162
169verbatim :: PandocMonad m => TWParser m B.Blocks
163verbatim :: PandocMonad m => TWParser m B.Blocks
170−verbatim = (htmlElement "verbatim" <|> htmlElement "pre")
171− >>= return . (uncurry B.codeBlockWith)
164+verbatim = uncurry B.codeBlockWith <$> (htmlElement "verbatim" <|> htmlElement "pre")
172
165
173literal :: PandocMonad m => TWParser m B.Blocks
166literal :: PandocMonad m => TWParser m B.Blocks
174−literal = htmlElement "literal" >>= return . rawBlock
167+literal = rawBlock <$> htmlElement "literal"
175 where
168 where
176 format (_, _, kvs) = fromMaybe "html" $ lookup "format" kvs
169 format (_, _, kvs) = fromMaybe "html" $ lookup "format" kvs
177 rawBlock (attrs, content) = B.rawBlock (format attrs) content
170 rawBlock (attrs, content) = B.rawBlock (format attrs) content
@@ -183,7 +176,7 @@ list prefix = choice [ bulletList prefix
183
176
184definitionList :: PandocMonad m => String -> TWParser m B.Blocks
177definitionList :: PandocMonad m => String -> TWParser m B.Blocks
185definitionList prefix = tryMsg "definitionList" $ do
178definitionList prefix = tryMsg "definitionList" $ do
186− indent <- lookAhead $ string prefix *> (many1 $ string " ") <* string "$ "
179+ indent <- lookAhead $ string prefix *> many1 (string " ") <* string "$ "
187 elements <- many $ parseDefinitionListItem (prefix ++ concat indent)
180 elements <- many $ parseDefinitionListItem (prefix ++ concat indent)
188 return $ B.definitionList elements
181 return $ B.definitionList elements
189 where
182 where
@@ -193,7 +186,7 @@ definitionList prefix = tryMsg "definitionList" $ do
193 string (indent ++ "$ ") >> skipSpaces
186 string (indent ++ "$ ") >> skipSpaces
194 term <- many1Till inline $ string ": "
187 term <- many1Till inline $ string ": "
195 line <- listItemLine indent $ string "$ "
188 line <- listItemLine indent $ string "$ "
196− return $ (mconcat term, [line])
189+ return (mconcat term, [line])
197
190
198bulletList :: PandocMonad m => String -> TWParser m B.Blocks
191bulletList :: PandocMonad m => String -> TWParser m B.Blocks
199bulletList prefix = tryMsg "bulletList" $
192bulletList prefix = tryMsg "bulletList" $
@@ -227,25 +220,24 @@ parseListItem prefix marker = string prefix >> marker >> listItemLine prefix mar
227
220
228listItemLine :: (PandocMonad m, Show a)
221listItemLine :: (PandocMonad m, Show a)
229 => String -> TWParser m a -> TWParser m B.Blocks
222 => String -> TWParser m a -> TWParser m B.Blocks
230−listItemLine prefix marker = lineContent >>= parseContent >>= return . mconcat
223+listItemLine prefix marker = mconcat <$> (lineContent >>= parseContent)
231 where
224 where
232 lineContent = do
225 lineContent = do
233 content <- anyLine
226 content <- anyLine
234 continuation <- optionMaybe listContinuation
227 continuation <- optionMaybe listContinuation
235− return $ filterSpaces content ++ "\n" ++ (maybe "" (" " ++) continuation)
228+ return $ filterSpaces content ++ "\n" ++ maybe "" (" " ++) continuation
236 filterSpaces = reverse . dropWhile (== ' ') . reverse
229 filterSpaces = reverse . dropWhile (== ' ') . reverse
237 listContinuation = notFollowedBy (string prefix >> marker) >>
230 listContinuation = notFollowedBy (string prefix >> marker) >>
238 string " " >> lineContent
231 string " " >> lineContent
239 parseContent = parseFromString' $ many1 $ nestedList <|> parseInline
232 parseContent = parseFromString' $ many1 $ nestedList <|> parseInline
240− parseInline = many1Till inline (lastNewline <|> newlineBeforeNestedList) >>=
233+ parseInline = (B.plain . mconcat) <$> many1Till inline (lastNewline <|> newlineBeforeNestedList)
241− return . B.plain . mconcat
242 nestedList = list prefix
234 nestedList = list prefix
243 lastNewline = try $ char '\n' <* eof
235 lastNewline = try $ char '\n' <* eof
244 newlineBeforeNestedList = try $ char '\n' <* lookAhead nestedList
236 newlineBeforeNestedList = try $ char '\n' <* lookAhead nestedList
245
237
246table :: PandocMonad m => TWParser m B.Blocks
238table :: PandocMonad m => TWParser m B.Blocks
247table = try $ do
239table = try $ do
248− tableHead <- optionMaybe $ many1Till tableParseHeader newline >>= return . unzip
240+ tableHead <- optionMaybe (unzip <$> many1Till tableParseHeader newline)
249 rows <- many1 tableParseRow
241 rows <- many1 tableParseRow
250 return $ buildTable mempty rows $ fromMaybe (align rows, columns rows) tableHead
242 return $ buildTable mempty rows $ fromMaybe (align rows, columns rows) tableHead
251 where
243 where
@@ -258,11 +250,11 @@ table = try $ do
258tableParseHeader :: PandocMonad m => TWParser m ((Alignment, Double), B.Blocks)
250tableParseHeader :: PandocMonad m => TWParser m ((Alignment, Double), B.Blocks)
259tableParseHeader = try $ do
251tableParseHeader = try $ do
260 char '|'
252 char '|'
261− leftSpaces <- many spaceChar >>= return . length
253+ leftSpaces <- length <$> many spaceChar
262 char '*'
254 char '*'
263 content <- tableColumnContent (char '*' >> skipSpaces >> char '|')
255 content <- tableColumnContent (char '*' >> skipSpaces >> char '|')
264 char '*'
256 char '*'
265− rightSpaces <- many spaceChar >>= return . length
257+ rightSpaces <- length <$> many spaceChar
266 optional tableEndOfRow
258 optional tableEndOfRow
267 return (tableAlign leftSpaces rightSpaces, content)
259 return (tableAlign leftSpaces rightSpaces, content)
268 where
260 where
@@ -283,13 +275,13 @@ tableEndOfRow :: PandocMonad m => TWParser m Char
283tableEndOfRow = lookAhead (try $ char '|' >> char '\n') >> char '|'
275tableEndOfRow = lookAhead (try $ char '|' >> char '\n') >> char '|'
284
276
285tableColumnContent :: PandocMonad m => TWParser m a -> TWParser m B.Blocks
277tableColumnContent :: PandocMonad m => TWParser m a -> TWParser m B.Blocks
286−tableColumnContent end = manyTill content (lookAhead $ try end) >>= return . B.plain . mconcat
278+tableColumnContent end = (B.plain . mconcat) <$> manyTill content (lookAhead $ try end)
287 where
279 where
288 content = continuation <|> inline
280 content = continuation <|> inline
289 continuation = try $ char '\\' >> newline >> return mempty
281 continuation = try $ char '\\' >> newline >> return mempty
290
282
291blockQuote :: PandocMonad m => TWParser m B.Blocks
283blockQuote :: PandocMonad m => TWParser m B.Blocks
292−blockQuote = parseHtmlContent "blockquote" block >>= return . B.blockQuote . mconcat
284+blockQuote = (B.blockQuote . mconcat) <$> parseHtmlContent "blockquote" block
293
285
294noautolink :: PandocMonad m => TWParser m B.Blocks
286noautolink :: PandocMonad m => TWParser m B.Blocks
295noautolink = do
287noautolink = do
@@ -300,15 +292,15 @@ noautolink = do
300 setState $ st{ stateAllowLinks = True }
292 setState $ st{ stateAllowLinks = True }
301 return $ mconcat blocks
293 return $ mconcat blocks
302 where
294 where
303− parseContent = parseFromString' $ many $ block
295+ parseContent = parseFromString' $ many block
304
296
305para :: PandocMonad m => TWParser m B.Blocks
297para :: PandocMonad m => TWParser m B.Blocks
306−para = many1Till inline endOfParaElement >>= return . result . mconcat
298+para = (result . mconcat) <$> many1Till inline endOfParaElement
307 where
299 where
308 endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement
300 endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement
309 endOfInput = try $ skipMany blankline >> skipSpaces >> eof
301 endOfInput = try $ skipMany blankline >> skipSpaces >> eof
310 endOfPara = try $ blankline >> skipMany1 blankline
302 endOfPara = try $ blankline >> skipMany1 blankline
311− newBlockElement = try $ blankline >> skip blockElements
303+ newBlockElement = try $ blankline >> void blockElements
312 result content = if F.all (==Space) content
304 result content = if F.all (==Space) content
313 then mempty
305 then mempty
314 else B.para $ B.trimInlines content
306 else B.para $ B.trimInlines content
@@ -340,7 +332,7 @@ inline = choice [ whitespace
340 ] <?> "inline"
332 ] <?> "inline"
341
333
342whitespace :: PandocMonad m => TWParser m B.Inlines
334whitespace :: PandocMonad m => TWParser m B.Inlines
343−whitespace = (lb <|> regsp) >>= return
335+whitespace = lb <|> regsp
344 where lb = try $ skipMany spaceChar >> linebreak >> return B.space
336 where lb = try $ skipMany spaceChar >> linebreak >> return B.space
345 regsp = try $ skipMany1 spaceChar >> return B.space
337 regsp = try $ skipMany1 spaceChar >> return B.space
346
338
@@ -362,13 +354,13 @@ enclosed :: (Monoid b, PandocMonad m, Show a)
362 => TWParser m a -> (TWParser m a -> TWParser m b) -> TWParser m b
354 => TWParser m a -> (TWParser m a -> TWParser m b) -> TWParser m b
363enclosed sep p = between sep (try $ sep <* endMarker) p
355enclosed sep p = between sep (try $ sep <* endMarker) p
364 where
356 where
365− endMarker = lookAhead $ skip endSpace <|> skip (oneOf ".,!?:)|") <|> eof
357+ endMarker = lookAhead $ void endSpace <|> void (oneOf ".,!?:)|") <|> eof
366 endSpace = (spaceChar <|> newline) >> return B.space
358 endSpace = (spaceChar <|> newline) >> return B.space
367
359
368macro :: PandocMonad m => TWParser m B.Inlines
360macro :: PandocMonad m => TWParser m B.Inlines
369macro = macroWithParameters <|> withoutParameters
361macro = macroWithParameters <|> withoutParameters
370 where
362 where
371− withoutParameters = enclosed (char '%') (\_ -> macroName) >>= return . emptySpan
363+ withoutParameters = emptySpan <$> enclosed (char '%') (const macroName)
372 emptySpan name = buildSpan name [] mempty
364 emptySpan name = buildSpan name [] mempty
373
365
374macroWithParameters :: PandocMonad m => TWParser m B.Inlines
366macroWithParameters :: PandocMonad m => TWParser m B.Inlines
@@ -393,13 +385,13 @@ macroName = do
393 return (first:rest)
385 return (first:rest)
394
386
395attributes :: PandocMonad m => TWParser m (String, [(String, String)])
387attributes :: PandocMonad m => TWParser m (String, [(String, String)])
396−attributes = char '{' *> spnl *> many (attribute <* spnl) <* char '}' >>=
397− return . foldr (either mkContent mkKvs) ([], [])
388+attributes = foldr (either mkContent mkKvs) ([], [])
389+ <$> (char '{' *> spnl *> many (attribute <* spnl) <* char '}')
398 where
390 where
399 spnl = skipMany (spaceChar <|> newline)
391 spnl = skipMany (spaceChar <|> newline)
400 mkContent c ([], kvs) = (c, kvs)
392 mkContent c ([], kvs) = (c, kvs)
401 mkContent c (rest, kvs) = (c ++ " " ++ rest, kvs)
393 mkContent c (rest, kvs) = (c ++ " " ++ rest, kvs)
402− mkKvs kv (cont, rest) = (cont, (kv : rest))
394+ mkKvs kv (cont, rest) = (cont, kv : rest)
403
395
404attribute :: PandocMonad m => TWParser m (Either String (String, String))
396attribute :: PandocMonad m => TWParser m (Either String (String, String))
405attribute = withKey <|> withoutKey
397attribute = withKey <|> withoutKey
@@ -407,52 +399,50 @@ attribute = withKey <|> withoutKey
407 withKey = try $ do
399 withKey = try $ do
408 key <- macroName
400 key <- macroName
409 char '='
401 char '='
410− parseValue False >>= return . (curry Right key)
402+ curry Right key <$> parseValue False
411− withoutKey = try $ parseValue True >>= return . Left
403+ withoutKey = try $ Left <$> parseValue True
412− parseValue allowSpaces = (withQuotes <|> withoutQuotes allowSpaces) >>= return . fromEntities
404+ parseValue allowSpaces = fromEntities <$> (withQuotes <|> withoutQuotes allowSpaces)
413 withQuotes = between (char '"') (char '"') (\_ -> count 1 $ noneOf ['"'])
405 withQuotes = between (char '"') (char '"') (\_ -> count 1 $ noneOf ['"'])
414 withoutQuotes allowSpaces
406 withoutQuotes allowSpaces
415− | allowSpaces == True = many1 $ noneOf "}"
407+ | allowSpaces = many1 $ noneOf "}"
416− | otherwise = many1 $ noneOf " }"
408+ | otherwise = many1 $ noneOf " }"
417
409
418nestedInlines :: (Show a, PandocMonad m)
410nestedInlines :: (Show a, PandocMonad m)
419 => TWParser m a -> TWParser m B.Inlines
411 => TWParser m a -> TWParser m B.Inlines
420nestedInlines end = innerSpace <|> nestedInline
412nestedInlines end = innerSpace <|> nestedInline
421 where
413 where
422− innerSpace = try $ whitespace <* (notFollowedBy end)
414+ innerSpace = try $ whitespace <* notFollowedBy end
423 nestedInline = notFollowedBy whitespace >> nested inline
415 nestedInline = notFollowedBy whitespace >> nested inline
424
416
425strong :: PandocMonad m => TWParser m B.Inlines
417strong :: PandocMonad m => TWParser m B.Inlines
426−strong = try $ enclosed (char '*') nestedInlines >>= return . B.strong
418+strong = try $ B.strong <$> enclosed (char '*') nestedInlines
427
419
428strongHtml :: PandocMonad m => TWParser m B.Inlines
420strongHtml :: PandocMonad m => TWParser m B.Inlines
429−strongHtml = (parseHtmlContent "strong" inline <|> parseHtmlContent "b" inline)
421+strongHtml = B.strong . mconcat <$> (parseHtmlContent "strong" inline <|> parseHtmlContent "b" inline)
430− >>= return . B.strong . mconcat
431
422
432strongAndEmph :: PandocMonad m => TWParser m B.Inlines
423strongAndEmph :: PandocMonad m => TWParser m B.Inlines
433−strongAndEmph = try $ enclosed (string "__") nestedInlines >>= return . B.emph . B.strong
424+strongAndEmph = try $ B.emph . B.strong <$> enclosed (string "__") nestedInlines
434
425
435emph :: PandocMonad m => TWParser m B.Inlines
426emph :: PandocMonad m => TWParser m B.Inlines
436−emph = try $ enclosed (char '_') nestedInlines >>= return . B.emph
427+emph = try $ B.emph <$> enclosed (char '_') nestedInlines
437
428
438emphHtml :: PandocMonad m => TWParser m B.Inlines
429emphHtml :: PandocMonad m => TWParser m B.Inlines
439−emphHtml = (parseHtmlContent "em" inline <|> parseHtmlContent "i" inline)
430+emphHtml = B.emph . mconcat <$> (parseHtmlContent "em" inline <|> parseHtmlContent "i" inline)
440− >>= return . B.emph . mconcat
441
431
442nestedString :: (Show a, PandocMonad m)
432nestedString :: (Show a, PandocMonad m)
443 => TWParser m a -> TWParser m String
433 => TWParser m a -> TWParser m String
444−nestedString end = innerSpace <|> (count 1 nonspaceChar)
434+nestedString end = innerSpace <|> count 1 nonspaceChar
445 where
435 where
446 innerSpace = try $ many1 spaceChar <* notFollowedBy end
436 innerSpace = try $ many1 spaceChar <* notFollowedBy end
447
437
448boldCode :: PandocMonad m => TWParser m B.Inlines
438boldCode :: PandocMonad m => TWParser m B.Inlines
449−boldCode = try $ enclosed (string "==") nestedString >>= return . B.strong . B.code . fromEntities
439+boldCode = try $ (B.strong . B.code . fromEntities) <$> enclosed (string "==") nestedString
450
440
451htmlComment :: PandocMonad m => TWParser m B.Inlines
441htmlComment :: PandocMonad m => TWParser m B.Inlines
452htmlComment = htmlTag isCommentTag >> return mempty
442htmlComment = htmlTag isCommentTag >> return mempty
453
443
454code :: PandocMonad m => TWParser m B.Inlines
444code :: PandocMonad m => TWParser m B.Inlines
455−code = try $ enclosed (char '=') nestedString >>= return . B.code . fromEntities
445+code = try $ (B.code . fromEntities) <$> enclosed (char '=') nestedString
456
446
457codeHtml :: PandocMonad m => TWParser m B.Inlines
447codeHtml :: PandocMonad m => TWParser m B.Inlines
458codeHtml = do
448codeHtml = do
@@ -464,7 +454,7 @@ autoLink = try $ do
464 state <- getState
454 state <- getState
465 guard $ stateAllowLinks state
455 guard $ stateAllowLinks state
466 (text, url) <- parseLink
456 (text, url) <- parseLink
467− guard $ checkLink (head $ reverse url)
457+ guard $ checkLink (last url)
468 return $ makeLink (text, url)
458 return $ makeLink (text, url)
469 where
459 where
470 parseLink = notFollowedBy nop >> (uri <|> emailAddress)
460 parseLink = notFollowedBy nop >> (uri <|> emailAddress)
@@ -474,17 +464,17 @@ autoLink = try $ do
474 | otherwise = isAlphaNum c
464 | otherwise = isAlphaNum c
475
465
476str :: PandocMonad m => TWParser m B.Inlines
466str :: PandocMonad m => TWParser m B.Inlines
477−str = (many1 alphaNum <|> count 1 characterReference) >>= return . B.str
467+str = B.str <$> (many1 alphaNum <|> count 1 characterReference)
478
468
479nop :: PandocMonad m => TWParser m B.Inlines
469nop :: PandocMonad m => TWParser m B.Inlines
480−nop = try $ (skip exclamation <|> skip nopTag) >> followContent
470+nop = try $ (void exclamation <|> void nopTag) >> followContent
481 where
471 where
482 exclamation = char '!'
472 exclamation = char '!'
483 nopTag = stringAnyCase "<nop>"
473 nopTag = stringAnyCase "<nop>"
484− followContent = many1 nonspaceChar >>= return . B.str . fromEntities
474+ followContent = B.str . fromEntities <$> many1 nonspaceChar
485
475
486symbol :: PandocMonad m => TWParser m B.Inlines
476symbol :: PandocMonad m => TWParser m B.Inlines
487−symbol = count 1 nonspaceChar >>= return . B.str
477+symbol = B.str <$> count 1 nonspaceChar
488
478
489smart :: PandocMonad m => TWParser m B.Inlines
479smart :: PandocMonad m => TWParser m B.Inlines
490smart = do
480smart = do
@@ -498,17 +488,16 @@ smart = do
498singleQuoted :: PandocMonad m => TWParser m B.Inlines
488singleQuoted :: PandocMonad m => TWParser m B.Inlines
499singleQuoted = try $ do
489singleQuoted = try $ do
500 singleQuoteStart
490 singleQuoteStart
501− withQuoteContext InSingleQuote $
491+ withQuoteContext InSingleQuote
502− many1Till inline singleQuoteEnd >>=
492+ (B.singleQuoted . B.trimInlines . mconcat <$> many1Till inline singleQuoteEnd)
503− (return . B.singleQuoted . B.trimInlines . mconcat)
504
493
505doubleQuoted :: PandocMonad m => TWParser m B.Inlines
494doubleQuoted :: PandocMonad m => TWParser m B.Inlines
506doubleQuoted = try $ do
495doubleQuoted = try $ do
507 doubleQuoteStart
496 doubleQuoteStart
508 contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
497 contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)
509− (withQuoteContext InDoubleQuote $ doubleQuoteEnd >>
498+ withQuoteContext InDoubleQuote (doubleQuoteEnd >>
510 return (B.doubleQuoted $ B.trimInlines contents))
499 return (B.doubleQuoted $ B.trimInlines contents))
511− <|> (return $ (B.str "\8220") B.<> contents)
500+ <|> return (B.str "\8220" B.<> contents)
512
501
513link :: PandocMonad m => TWParser m B.Inlines
502link :: PandocMonad m => TWParser m B.Inlines
514link = try $ do
503link = try $ do
@@ -527,5 +516,5 @@ linkText = do
527 char ']'
516 char ']'
528 return (url, "", content)
517 return (url, "", content)
529 where
518 where
530− linkContent = (char '[') >> many1Till anyChar (char ']') >>= parseLinkContent
519+ linkContent = char '[' >> many1Till anyChar (char ']') >>= parseLinkContent
531 parseLinkContent = parseFromString' $ many1 inline
520 parseLinkContent = parseFromString' $ many1 inline