From b8a0e5e85df87b3ae4d5fc37fc589163b2039bbd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 11 May 2026 12:30:20 +0200 Subject: [PATCH] Roff reader: handle `\` line continuation in table cells. Closes #11635. --- src/Text/Pandoc/Readers/Roff.hs | 3 ++- test/command/11635.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/command/11635.md diff --git a/src/Text/Pandoc/Readers/Roff.hs b/src/Text/Pandoc/Readers/Roff.hs index 607b7c922..134ee4c94 100644 --- a/src/Text/Pandoc/Readers/Roff.hs +++ b/src/Text/Pandoc/Readers/Roff.hs @@ -268,7 +268,8 @@ tableCell = do manyTill anyChar (try (string "T}")) simpleCell = do tabChar <- tableTabChar <$> getState - many (notFollowedBy (char tabChar <|> newline) >> anyChar) + many $ (char '\\' >> anyChar) + <|> (notFollowedBy (char tabChar <|> newline) >> anyChar) tableRow :: PandocMonad m => RoffLexer m [RoffTokens] tableRow = do diff --git a/test/command/11635.md b/test/command/11635.md new file mode 100644 index 000000000..1639c82f6 --- /dev/null +++ b/test/command/11635.md @@ -0,0 +1,28 @@ +``` +% pandoc -f man -t html +.TH "TEST" "1" "2026-05-08" "test v1.0.0" "test manual" +.SH HEADING +.TS +tab(;); +l l. +this is a table element \ +written in two lines;abcdefg +another \ +one;123456 +.TE +^D +

HEADING

+ + + + + + + + + + + +
this is a table element written in two +linesabcdefg
another one123456
+```