git.iko.soy/typeable/pandoc
on master help sign in
Fixed bug with intraword emphasis.
cf149fcJohn MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+2−1
@@ -1455,6 +1455,7 @@ enclosure c = do
1455-- Parse inlines til you hit one c or a sequence of two cs.
1455-- Parse inlines til you hit one c or a sequence of two cs.
1456-- If one c, emit emph and then parse two.
1456-- If one c, emit emph and then parse two.
1457-- If two cs, emit strong and then parse one.
1457-- If two cs, emit strong and then parse one.
1458+-- Otherwise, emit ccc then the results.
1458three :: Char -> MarkdownParser (F Inlines)
1459three :: Char -> MarkdownParser (F Inlines)
1459three c = do
1460three c = do
1460 contents <- mconcat <$> many (notFollowedBy (char c) >> inline)
1461 contents <- mconcat <$> many (notFollowedBy (char c) >> inline)
@@ -1479,7 +1480,7 @@ one c prefix' = do
1479 contents <- mconcat <$> many ( (notFollowedBy (char c) >> inline)
1480 contents <- mconcat <$> many ( (notFollowedBy (char c) >> inline)
1480 <|> try (string [c,c] >>
1481 <|> try (string [c,c] >>
1481 notFollowedBy (char c) >>
1482 notFollowedBy (char c) >>
1482− two c prefix') )
1483+ two c mempty) )
1483 (char c >> return (B.emph <$> (prefix' <> contents)))
1484 (char c >> return (B.emph <$> (prefix' <> contents)))
1484 <|> return (return (B.str [c]) <> (prefix' <> contents))
1485 <|> return (return (B.str [c]) <> (prefix' <> contents))
1485
1486
tests/Tests/Readers/Markdown.hs+5
@@ -136,6 +136,11 @@ tests = [ testGroup "inline code"
136 "`*` {.haskell .special x=\"7\"}"
136 "`*` {.haskell .special x=\"7\"}"
137 =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
137 =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
138 ]
138 ]
139+ , testGroup "emph and strong"
140+ [ "two strongs in emph" =:
141+ "***a**b **c**d*" =?> para (emph (strong (str "a") <> str "b" <> space
142+ <> strong (str "c") <> str "d"))
143+ ]
139 , testGroup "raw LaTeX"
144 , testGroup "raw LaTeX"
140 [ "in URL" =:
145 [ "in URL" =:
141 "\\begin\n" =?> para (text "\\begin")
146 "\\begin\n" =?> para (text "\\begin")