git.iko.soy/typeable/pandoc
on master help sign in
markdown reader: disallow space between inline code and attributes (#3326)

closes #3323

commit0159956f7fc008ecc28632920e700878aa3f5996 authorMauro Bieg <mb21@users.noreply.github.com> dateSat 24 Dec 2016, 15:34 (10 years ago) parentb872765
2 files changed+4−3
src/Text/Pandoc/Readers/Markdown.hs+2−2 tests/Tests/Readers/Markdown.hs+2−1
src/Text/Pandoc/Readers/Markdown.hs+2−2
@@ -1561,8 +1561,8 @@ code = try $ do
15611561 (char '\n' >> notFollowedBy' blankline >> return " "))
15621562 (try (skipSpaces >> count (length starts) (char '`') >>
15631563 notFollowedBy (char '`')))
1564− attr <- option ([],[],[]) (try $ guardEnabled Ext_inline_code_attributes >>
1565− optional whitespace >> attributes)
1564+ attr <- option ([],[],[]) (try $ guardEnabled Ext_inline_code_attributes
1565+ >> attributes)
15661566 return $ return $ B.codeWith attr $ trim $ concat result
15671567
15681568math :: MarkdownParser (F Inlines)
tests/Tests/Readers/Markdown.hs+2−1
@@ -149,7 +149,8 @@ tests = [ testGroup "inline code"
149149 (codeWith ("",["javascript"],[]) "document.write(\"Hello\");")
150150 , "with attribute space" =:
151151 "`*` {.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\"}")
153154 ]
154155 , testGroup "emph and strong"
155156 [ "two strongs in emph" =: