diff options
-rw-r--r-- | src/Text/Pandoc/Writers/RTF.hs | 2 | ||||
-rw-r--r-- | tests/tables.rtf | 184 |
2 files changed, 93 insertions, 93 deletions
diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index fb935fa6a..3e0bd9976 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -259,7 +259,7 @@ tableRowToRTF header indent aligns sizes' cols = tableItemToRTF :: Int -> Alignment -> [Block] -> String tableItemToRTF indent alignment item = let contents = concatMap (blockToRTF indent alignment) item - in "{\\intbl " ++ contents ++ "\\cell}\n" + in "{" ++ substitute "\\pard" "\\pard\\intbl" contents ++ "\\cell}\n" -- | Ensure that there's the same amount of space after compact -- lists as after regular lists. diff --git a/tests/tables.rtf b/tests/tables.rtf index 011724967..e1fe4aab1 100644 --- a/tests/tables.rtf +++ b/tests/tables.rtf @@ -4,13 +4,13 @@ \clbrdrb\brdrs\cellx2160\clbrdrb\brdrs\cellx4320\clbrdrb\brdrs\cellx6480\clbrdrb\brdrs\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 Right\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Left\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Center\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Center\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Default\par} \cell} } \intbl\row} @@ -19,13 +19,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} } \intbl\row} @@ -34,13 +34,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} } \intbl\row} @@ -49,13 +49,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} } \intbl\row} @@ -66,13 +66,13 @@ \clbrdrb\brdrs\cellx2160\clbrdrb\brdrs\cellx4320\clbrdrb\brdrs\cellx6480\clbrdrb\brdrs\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 Right\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Left\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Center\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Center\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Default\par} \cell} } \intbl\row} @@ -81,13 +81,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} } \intbl\row} @@ -96,13 +96,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} } \intbl\row} @@ -111,13 +111,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} } \intbl\row} @@ -128,13 +128,13 @@ \clbrdrb\brdrs\cellx2160\clbrdrb\brdrs\cellx4320\clbrdrb\brdrs\cellx6480\clbrdrb\brdrs\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 Right\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Left\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Center\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Center\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Default\par} \cell} } \intbl\row} @@ -143,13 +143,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} } \intbl\row} @@ -158,13 +158,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} } \intbl\row} @@ -173,13 +173,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} } \intbl\row} @@ -190,13 +190,13 @@ \clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Centered Header\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Centered Header\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left Aligned\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Left Aligned\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right Aligned\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 Right Aligned\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default aligned\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Default aligned\par} \cell} } \intbl\row} @@ -205,13 +205,13 @@ \cellx1296\cellx2484\cellx3888\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 First\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 First\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 row\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12.0\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12.0\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} \cell} } \intbl\row} @@ -220,13 +220,13 @@ \cellx1296\cellx2484\cellx3888\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Second\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Second\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 row\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 5.0\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 5.0\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} \cell} } \intbl\row} @@ -237,13 +237,13 @@ \clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Centered Header\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Centered Header\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left Aligned\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Left Aligned\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right Aligned\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 Right Aligned\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default aligned\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Default aligned\par} \cell} } \intbl\row} @@ -252,13 +252,13 @@ \cellx1296\cellx2484\cellx3888\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 First\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 First\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 row\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12.0\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12.0\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} \cell} } \intbl\row} @@ -267,13 +267,13 @@ \cellx1296\cellx2484\cellx3888\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Second\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Second\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 row\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 5.0\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 5.0\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} \cell} } \intbl\row} @@ -284,13 +284,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 12\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12\par} \cell} } \intbl\row} @@ -299,13 +299,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 123\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 123\par} \cell} } \intbl\row} @@ -314,13 +314,13 @@ \cellx2160\cellx4320\cellx6480\cellx8640 \trkeep\intbl { -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 1\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 1\par} \cell} } \intbl\row} @@ -331,13 +331,13 @@ \cellx1296\cellx2484\cellx3888\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 First\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 First\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 row\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12.0\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 12.0\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} \cell} } \intbl\row} @@ -346,13 +346,13 @@ \cellx1296\cellx2484\cellx3888\cellx6804 \trkeep\intbl { -{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Second\par} +{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Second\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 row\par} \cell} -{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 5.0\par} +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 5.0\par} \cell} -{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} \cell} } \intbl\row} |