git.iko.soy/typeable/pandoc
on master help sign in
Mediawiki reader: allow space around storng/emph delimiters.
23f964bJohn MacFarlane
src/Text/Pandoc/Readers/MediaWiki.hs+4−6
@@ -678,19 +678,17 @@ url = do
678-- | Parses a list of inlines between start and end delimiters.
678-- | Parses a list of inlines between start and end delimiters.
679inlinesBetween :: (PandocMonad m, Show b) => MWParser m a -> MWParser m b -> MWParser m Inlines
679inlinesBetween :: (PandocMonad m, Show b) => MWParser m a -> MWParser m b -> MWParser m Inlines
680inlinesBetween start end =
680inlinesBetween start end =
681− trimInlines . mconcat <$> try (start >> many1Till inner end)
681+ trimInlines . mconcat <$> try (start >> many1Till inline end)
682− where inner = innerSpace <|> (notFollowedBy' (() <$ whitespace) >> inline)
683− innerSpace = try $ whitespace <* notFollowedBy' end
684
682
685emph :: PandocMonad m => MWParser m Inlines
683emph :: PandocMonad m => MWParser m Inlines
686emph = B.emph <$> nested (inlinesBetween start end)
684emph = B.emph <$> nested (inlinesBetween start end)
687− where start = sym "''" >> lookAhead nonspaceChar
685+ where start = sym "''"
688 end = try $ notFollowedBy' (() <$ strong) >> sym "''"
686 end = try $ notFollowedBy' (() <$ strong) >> sym "''"
689
687
690strong :: PandocMonad m => MWParser m Inlines
688strong :: PandocMonad m => MWParser m Inlines
691strong = B.strong <$> nested (inlinesBetween start end)
689strong = B.strong <$> nested (inlinesBetween start end)
692− where start = sym "'''" >> lookAhead nonspaceChar
690+ where start = sym "'''"
693− end = try $ sym "'''"
691+ end = sym "'''"
694
692
695doubleQuotes :: PandocMonad m => MWParser m Inlines
693doubleQuotes :: PandocMonad m => MWParser m Inlines
696doubleQuotes = do
694doubleQuotes = do
test/command/6993.mdnew file+21
@@ -0,0 +1,21 @@
1+```
2+% pandoc -f mediawiki -t native
3+'''Should be bold '''
4+^D
5+[Para [Strong [Str "Should",Space,Str "be",Space,Str "bold"]]]
6+```
7+
8+```
9+% pandoc -f mediawiki -t native
10+''' Should be bold'''
11+^D
12+[Para [Strong [Str "Should",Space,Str "be",Space,Str "bold"]]]
13+```
14+
15+```
16+% pandoc -f mediawiki -t native
17+'' Should be emph ''
18+^D
19+[Para [Emph [Str "Should",Space,Str "be",Space,Str "emph"]]]
20+```
21+