@@ -1557,9 +1557,9 @@ ender c n = try $ do
15571557three :: PandocMonad m => Char -> MarkdownParser m (F Inlines)
15581558three c = do
15591559 contents <- mconcat <$> many (notFollowedBy (ender c 1) >> inline)
1560− (ender c 3 >> return ((B.strong . B.emph) <$> contents))
1561− <|> (ender c 2 >> one c (B.strong <$> contents))
1562− <|> (ender c 1 >> two c (B.emph <$> contents))
1560+ (ender c 3 >> updateLastStrPos >> return ((B.strong . B.emph) <$> contents))
1561+ <|> (ender c 2 >> updateLastStrPos >> one c (B.strong <$> contents))
1562+ <|> (ender c 1 >> updateLastStrPos >> two c (B.emph <$> contents))
15631563 <|> return (return (B.str [c,c,c]) <> contents)
15641564
15651565-- Parse inlines til you hit two c's, and emit strong.
@@ -1567,7 +1567,8 @@ three c = do
15671567two :: PandocMonad m => Char -> F Inlines -> MarkdownParser m (F Inlines)
15681568two c prefix' = do
15691569 contents <- mconcat <$> many (try $ notFollowedBy (ender c 2) >> inline)
1570− (ender c 2 >> return (B.strong <$> (prefix' <> contents)))
1570+ (ender c 2 >> updateLastStrPos >>
1571+ return (B.strong <$> (prefix' <> contents)))
15711572 <|> return (return (B.str [c,c]) <> (prefix' <> contents))
15721573
15731574-- Parse inlines til you hit a c, and emit emph.
@@ -1578,7 +1579,7 @@ one c prefix' = do
15781579 <|> try (string [c,c] >>
15791580 notFollowedBy (ender c 1) >>
15801581 two c mempty) )
1581− (ender c 1 >> return (B.emph <$> (prefix' <> contents)))
1582+ (ender c 1 >> updateLastStrPos >> return (B.emph <$> (prefix' <> contents)))
15821583 <|> return (return (B.str [c]) <> (prefix' <> contents))
15831584
15841585strongOrEmph :: PandocMonad m => MarkdownParser m (F Inlines)