@@ -519,7 +519,7 @@ rawLaTeXEnvironment' = do
519519-- inline
520520--
521521
522−text = choice [ math, strong, emph, code2, code1, str, linebreak, tabchar,
522+text = choice [ math, strong, emph, code, str, linebreak, tabchar,
523523 whitespace, endline ] <?> "text"
524524
525525inline = choice [ rawLaTeXInline', escapedChar, special, hyphens, text,
@@ -548,23 +548,15 @@ hyphens = try (do
548548 else do{ string ""; return Space }
549549 return (Str result))
550550
551−-- parses inline code, between codeStart and codeEnd
552−code1 = try (do
553− char codeStart
554− result <- many (noneOf [codeEnd])
555− char codeEnd
551+-- parses inline code, between n codeStarts and n codeEnds
552+code = try (do
553+ starts <- many1 (char codeStart)
554+ let num = length starts
555+ result <- many1Till anyChar (try (count num (char codeEnd)))
556556 -- get rid of any internal newlines
557557 let result' = removeLeadingTrailingSpace $ joinWithSep " " $ lines result
558558 return (Code result'))
559559
560−-- parses inline code, between 2 codeStarts and 2 codeEnds
561−code2 = try (do
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'))
567−
568560mathWord = many1 (choice [ (noneOf (" \t\n\\" ++ [mathEnd])),
569561 (try (do
570562 c <- char '\\'