@@ -857,7 +857,8 @@ listLine continuationIndent = try $ do
858listLineCommon :: PandocMonad m => MarkdownParser m String
858listLineCommon :: PandocMonad m => MarkdownParser m String
859listLineCommon = concat <$> manyTill
859listLineCommon = concat <$> manyTill
860− ( many1 (satisfy $ \c -> c /= '\n' && c /= '<')
860+ ( many1 (satisfy $ \c -> c `notElem` ['\n', '<', '`'])
861+ <|> fmap snd (withRaw code)
861 <|> fmap snd (htmlTag isCommentTag)
862 <|> fmap snd (htmlTag isCommentTag)
862 <|> count 1 anyChar
863 <|> count 1 anyChar
863 ) newline
864 ) newline
@@ -932,14 +933,14 @@ listItem :: PandocMonad m
932 -> MarkdownParser m a
933 -> MarkdownParser m a
933 -> MarkdownParser m (F Blocks)
934 -> MarkdownParser m (F Blocks)
934listItem fourSpaceRule start = try $ do
935listItem fourSpaceRule start = try $ do
935− (first, continuationIndent) <- rawListItem fourSpaceRule start
936− continuations <- many (listContinuation continuationIndent)
937 -- parsing with ListItemState forces markers at beginning of lines to
936 -- parsing with ListItemState forces markers at beginning of lines to
938 -- count as list item markers, even if not separated by blank space.
937 -- count as list item markers, even if not separated by blank space.
939 -- see definition of "endline"
938 -- see definition of "endline"
940 state <- getState
939 state <- getState
941 let oldContext = stateParserContext state
940 let oldContext = stateParserContext state
942 setState $ state {stateParserContext = ListItemState}
941 setState $ state {stateParserContext = ListItemState}
942+ (first, continuationIndent) <- rawListItem fourSpaceRule start
943+ continuations <- many (listContinuation continuationIndent)
943 -- parse the extracted block, which may contain various block elements:
944 -- parse the extracted block, which may contain various block elements:
944 let raw = concat (first:continuations)
945 let raw = concat (first:continuations)
945 contents <- parseFromString' parseBlocks raw
946 contents <- parseFromString' parseBlocks raw
@@ -1583,8 +1584,9 @@ code = try $ do
1583 starts <- many1 (char '`')
1584 starts <- many1 (char '`')
1584 skipSpaces
1585 skipSpaces
1585 result <- (trim . concat) <$>
1586 result <- (trim . concat) <$>
1587+ manyTill (notFollowedBy (inList >> listStart) >>
1586− manyTill (many1 (noneOf "`\n") <|> many1 (char '`') <|>
1588+ (many1 (noneOf "`\n") <|> many1 (char '`') <|>
1587− (char '\n' >> notFollowedBy' blankline >> return " "))
1589+ (char '\n' >> notFollowedBy' blankline >> return " ")))
1588 (try (skipSpaces >> count (length starts) (char '`') >>
1590 (try (skipSpaces >> count (length starts) (char '`') >>
1589 notFollowedBy (char '`')))
1591 notFollowedBy (char '`')))
1590 rawattr <-
1592 rawattr <-