Markdown reader: allow empty code spans.

E.g. `` ` ` ``.
This commit is contained in:
John MacFarlane 2018-06-13 11:12:10 -07:00
parent e9b81bf5c4
commit 48a505c5a0
2 changed files with 7 additions and 1 deletions

View file

@ -1591,7 +1591,7 @@ code = try $ do
starts <- many1 (char '`')
skipSpaces
result <- (trim . concat) <$>
many1Till (many1 (noneOf "`\n") <|> many1 (char '`') <|>
manyTill (many1 (noneOf "`\n") <|> many1 (char '`') <|>
(char '\n' >> notFollowedBy' blankline >> return " "))
(try (skipSpaces >> count (length starts) (char '`') >>
notFollowedBy (char '`')))

View file

@ -0,0 +1,6 @@
```
% pandoc -t native
` `
^D
[Code ("",[],[]) ""]
```