git.iko.soy/typeable/pandoc
on master help sign in
markdown reader: disallow space between inline code and attributes (#3326)
0159956Mauro Bieg
src/Text/Pandoc/Readers/Markdown.hs+2−2
@@ -1561,8 +1561,8 @@ code = try $ do
1561 (char '\n' >> notFollowedBy' blankline >> return " "))
1561 (char '\n' >> notFollowedBy' blankline >> return " "))
1562 (try (skipSpaces >> count (length starts) (char '`') >>
1562 (try (skipSpaces >> count (length starts) (char '`') >>
1563 notFollowedBy (char '`')))
1563 notFollowedBy (char '`')))
1564− attr <- option ([],[],[]) (try $ guardEnabled Ext_inline_code_attributes >>
1564+ attr <- option ([],[],[]) (try $ guardEnabled Ext_inline_code_attributes
1565− optional whitespace >> attributes)
1565+ >> attributes)
1566 return $ return $ B.codeWith attr $ trim $ concat result
1566 return $ return $ B.codeWith attr $ trim $ concat result
1567
1567
1568math :: MarkdownParser (F Inlines)
1568math :: MarkdownParser (F Inlines)
tests/Tests/Readers/Markdown.hs+2−1
@@ -149,7 +149,8 @@ tests = [ testGroup "inline code"
149 (codeWith ("",["javascript"],[]) "document.write(\"Hello\");")
149 (codeWith ("",["javascript"],[]) "document.write(\"Hello\");")
150 , "with attribute space" =:
150 , "with attribute space" =:
151 "`*` {.haskell .special x=\"7\"}"
151 "`*` {.haskell .special x=\"7\"}"
152− =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
152+ =?> para (code "*" <> space <> str "{.haskell" <> space <>
153+ str ".special" <> space <> str "x=\"7\"}")
153 ]
154 ]
154 , testGroup "emph and strong"
155 , testGroup "emph and strong"
155 [ "two strongs in emph" =:
156 [ "two strongs in emph" =: