@@ -519,7 +519,7 @@ rawLaTeXEnvironment' = do
522−text = choice [ math, strong, emph, code2, code1, str, linebreak, tabchar,
522+text = choice [ math, strong, emph, code, str, linebreak, tabchar,
523 whitespace, endline ] <?> "text"
523 whitespace, endline ] <?> "text"
525inline = choice [ rawLaTeXInline', escapedChar, special, hyphens, text,
525inline = choice [ rawLaTeXInline', escapedChar, special, hyphens, text,
@@ -548,23 +548,15 @@ hyphens = try (do
548 else do{ string ""; return Space }
548 else do{ string ""; return Space }
549 return (Str result))
549 return (Str result))
551−-- parses inline code, between codeStart and codeEnd
551+-- parses inline code, between n codeStarts and n codeEnds
552−code1 = try (do
552+code = try (do
553− char codeStart
553+ starts <- many1 (char codeStart)
554− result <- many (noneOf [codeEnd])
554+ let num = length starts
555− char codeEnd
555+ result <- many1Till anyChar (try (count num (char codeEnd)))
556 -- get rid of any internal newlines
556 -- get rid of any internal newlines
557 let result' = removeLeadingTrailingSpace $ joinWithSep " " $ lines result
557 let result' = removeLeadingTrailingSpace $ joinWithSep " " $ lines result
558 return (Code result'))
558 return (Code result'))
560−-- parses inline code, between 2 codeStarts and 2 codeEnds
562− string [codeStart, codeStart]
563− result <- manyTill anyChar (try (string [codeEnd, codeEnd]))
564− let result' = removeLeadingTrailingSpace $ joinWithSep " " $ lines result
565− -- get rid of any internal newlines
566− return (Code result'))
568mathWord = many1 (choice [ (noneOf (" \t\n\\" ++ [mathEnd])),
560mathWord = many1 (choice [ (noneOf (" \t\n\\" ++ [mathEnd])),
570 c <- char '\\'
562 c <- char '\\'