public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Multiline table for XWiki writer does not render correctly
@ 2019-08-10  8:16 Zihang Chen
  0 siblings, 0 replies; only message in thread
From: Zihang Chen @ 2019-08-10  8:16 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3967 bytes --]

Hello,

Apologies if this is not the place to discuss this sort of things.

TL;DR: I have a fix for the XWiki writer regarding multiline table at [0], 
but am not sure how to (or rather, should I) add a test for it.

[0]: https://github.com/jgm/pandoc/compare/master...qwert42:master

I wanted to convert a Markdown with some tables that have multiline blocks 
as cells (for example, a list of two items in a cell) to an XWiki document.

For the following content [1], the latest pandoc (2.7.3), gives the 
following output [2]

[1]:

+--------------------------------------------------+--------------------------------------------------------+
| Symptom                                          | Possible Cause(s)      
                                |
+==================================================+========================================================+
| `param1`, `param2`,                              | * The distribution you 
chose was bad.                  |
| `param3`, or `param4` is                         | * You should change 
your distribution.                 |
| non-zero and relatively low                      |                        
                                |
+--------------------------------------------------+--------------------------------------------------------+
| `param1` is very high                            | * Your custom 
distribution did not work properly.      |
|                                                  | * Your distribution 
took too long to be warmed up.     |
+--------------------------------------------------+--------------------------------------------------------+

[2]:

|=Symptom |=Possible Cause(s)
|{{code}}param1{{/code}}, {{code}}param2{{/code}}, {{code}}param3{{/code}}, 
or {{code}}param4{{/code}} is non-zero and relatively low |*. The 
distribution you chose was bad.
*. You should change your distribution.

|{{code}}param1{{/code}} is very high |*. Your custom distribution did not 
work properly.
*. Your distribution took too long to be warmed up.


This does not render correctly because the second item from the lists is 
put on its own line, which is ambiguous to XWiki and rendered as two 
tables, each followed by a list of a single item.

The correct way to render [1] into XWiki is to wrap the multiline block 
with "(((" and ")))", as in [3].

[3]:

|=Symptom |=Possible Cause(s)
|{{code}}param1{{/code}}, {{code}}param2{{/code}}, {{code}}param3{{/code}}, 
or {{code}}param4{{/code}} is non-zero and relatively low |(((*. The 
distribution you chose was bad.
*. You should change your distribution.
)))
|{{code}}param1{{/code}} is very high |(((*. Your custom distribution did 
not work properly.
*. Your distribution took too long to be warmed up.
)))


The fix is pretty straight forward (
https://github.com/jgm/pandoc/commit/f8fbf119884b58f5ae25734a5db0ac61dc54f2fb#diff-5690975d41d4601ba7fd4ed4739fad6c). 
But looking at the tests for multiline tables, I feel that the existing 
tests are insufficient. For example, 
https://github.com/jgm/pandoc/blame/master/test/tables.markdown#L35 claims 
that the cell spans multiple lines, but it's actually a single line element 
from the perspective of the Markdown reader. On the other hand though, I 
understand that not all formats support multiline cells. I guess my 
question is whether a test case for "real" multiline table is required for 
my fix, or if it's out of scope for it (because if it is, I'll probably 
need to add assertions for all other formats that support multiline table).

Thanks,
Zihang

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/83a7daef-b486-474d-9961-d59410d47a90%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 6999 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-10  8:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-10  8:16 Multiline table for XWiki writer does not render correctly Zihang Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).