Closed sabicalija closed 3 years ago
Sorry for the extremely late reply. :sweat:
The patch is relatively easy, as the commit above. I'm just considering an appropriate option sets, since it looks inconsistent to have rowspan
and colspanSyntax
options.
One rational solution lefts {colspan: "", rowspan: undefined}
as default. This changes behavior of rowspan
and thus have to propogate until v5.0.0; Moreover, the colspan
option must treat empty string as the special case, or regex comes in for the alternative syntax: \s*<<\s*
.
One compromising solution lefts {rowspan: false, colspanSyntax: undefined, rowspanSyntax: undefined}
as default. But it seems somewhat confusing and redundant, and colspan problem still exists.
I've noticed relevant discussion in CommonMark forum, but no conclusion drawn yet. I may left this branch unmerged until other Markdown derivatives proposed other solutions. :confused:
Would it be possible to add additional
colspan
syntax so that auto-formatting with prettier is supported out-of-the-box?When I write following table:
prettier will format it to:
thereby removing the
colspan
. Would it be possible to support something like the following, to avoid this issue:Prettier would format it to:
So, if the
colspan
syntax supports| >> |
in addition to||
, one could continue usingformatOnSave
with prettier. Allowing to configure this feature and escaping arrows (\>
) when needed, could solve possible conflicts.