Markdown reader: when splitting pipe table cells, skip tex math.

You might have a `|` character inside math.
(Or for that matter something that the parser might mistake
for raw HTML.)

See #3481.
This commit is contained in:
John MacFarlane 2017-03-02 10:25:12 +01:00
parent fe4311d5a1
commit fa59e2ef28

View file

@ -1401,7 +1401,7 @@ pipeTableRow = try $ do
skipMany spaceChar
openPipe <- (True <$ char '|') <|> return False
-- split into cells
let chunk = void (code <|> rawHtmlInline <|> escapedChar <|> rawLaTeXInline')
let chunk = void (code <|> math <|> rawHtmlInline <|> escapedChar <|> rawLaTeXInline')
<|> void (noneOf "|\n\r")
let cellContents = ((trim . snd) <$> withRaw (many chunk)) >>=
parseFromString pipeTableCell