@@ -857,7 +857,8 @@ listLine continuationIndent = try $ do
857857
858858listLineCommon :: PandocMonad m => MarkdownParser m String
859859listLineCommon = concat <$> manyTill
860− ( many1 (satisfy $ \c -> c /= '\n' && c /= '<')
860+ ( many1 (satisfy $ \c -> c `notElem` ['\n', '<', '`'])
861+ <|> fmap snd (withRaw code)
861862 <|> fmap snd (htmlTag isCommentTag)
862863 <|> count 1 anyChar
863864 ) newline
@@ -932,14 +933,14 @@ listItem :: PandocMonad m
932933 -> MarkdownParser m a
933934 -> MarkdownParser m (F Blocks)
934935listItem fourSpaceRule start = try $ do
935− (first, continuationIndent) <- rawListItem fourSpaceRule start
936− continuations <- many (listContinuation continuationIndent)
937936 -- parsing with ListItemState forces markers at beginning of lines to
938937 -- count as list item markers, even if not separated by blank space.
939938 -- see definition of "endline"
940939 state <- getState
941940 let oldContext = stateParserContext state
942941 setState $ state {stateParserContext = ListItemState}
942+ (first, continuationIndent) <- rawListItem fourSpaceRule start
943+ continuations <- many (listContinuation continuationIndent)
943944 -- parse the extracted block, which may contain various block elements:
944945 let raw = concat (first:continuations)
945946 contents <- parseFromString' parseBlocks raw
@@ -1583,8 +1584,9 @@ code = try $ do
15831584 starts <- many1 (char '`')
15841585 skipSpaces
15851586 result <- (trim . concat) <$>
1586− manyTill (many1 (noneOf "`\n") <|> many1 (char '`') <|>
1587− (char '\n' >> notFollowedBy' blankline >> return " "))
1587+ manyTill (notFollowedBy (inList >> listStart) >>
1588+ (many1 (noneOf "`\n") <|> many1 (char '`') <|>
1589+ (char '\n' >> notFollowedBy' blankline >> return " ")))
15881590 (try (skipSpaces >> count (length starts) (char '`') >>
15891591 notFollowedBy (char '`')))
15901592 rawattr <-