Rtf to MD table convertation problem

Good afternoon, at the moment we have a problem with converting from RTF to MD and when converting a table with merged cells we get the following text. How can we fix this because it’s not a valid conversion?

I testing convertation here: https://dillinger.io/

Table:

Rtf text:

{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset204 Calibri;}{\f1\froman\fprq2\fcharset204 Times New Roman;}{\f2\fnil\fcharset204 Microsoft Sans Serif;}}
{\*\generator Riched20 10.0.19041}{\*\mmathPr\mnaryLim0\mdispDef1\mwrapIndent1440 }\viewkind4\uc1 
\pard\widctlpar\sa160\sl252\slmult1\f0\fs22\lang1049 123\par
\par
\trowd\trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trpaddl108\trpaddr108\trpaddfl3\trpaddfr3
\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx4680\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx9355 
\pard\intbl\widctlpar 1\cell 2\cell\row\trowd\trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trpaddl108\trpaddr108\trpaddfl3\trpaddfr3
\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx4680\clvmgf\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx9355 
\pard\intbl\widctlpar 3\cell 4\par
5\cell\row\trowd\trgaph108\trleft5\trbrdrl\brdrs\brdrw10 \trbrdrt\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trpaddl108\trpaddr108\trpaddfl3\trpaddfr3
\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx4680\clvmrg\clbrdrl\brdrw10\brdrs\clbrdrt\brdrw10\brdrs\clbrdrr\brdrw10\brdrs\clbrdrb\brdrw10\brdrs \cellx9355 
\pard\intbl\widctlpar 5\cell\cell\row 
\pard\widctlpar\sa160\sl252\slmult1\par
123\par

\pard\f2\fs23\par
}

MD Text:

123


|1|2|
| :- | :- |
|3|<p>4</p><p>5</p>|
|5||

123

@lecoye4578 Markdown does not allow creating tables with vertically merged cells. Aspose.Words output such table as injected HTML, since most of MD consumers supports HTML. Here is the output produced by the following code on my side:

Document doc = new Document(@"C:\Temp\in.rtf");
doc.Save(@"C:\Temp\out.md");

output

123


<table><tr><th colspan="1" valign="top">1</th><th colspan="1" valign="top">2</th></tr>
<tr><td colspan="1" valign="top">3</td><td colspan="1" rowspan="2" valign="top"><p>4</p><p>5</p></td></tr>
<tr><td colspan="1" valign="top">5</td></tr>
</table>

123

Here is how discourse interprets such markdown:

123

12
3

4

5

5

123

1 Like

Thank you very much for your answer, please tell me about horizontal columns. Do you have support? I got this syntax and tried to convert it into a table in rtf and html but everything was unsuccessful

|1|
| :- |
|11|22|33|
|111|222|333|

@lecoye4578 This is not Aspose.Words restriction, this is Markdown format restriction. Here is a quote from GitHub markdown specification.

The remainder of the table’s rows may vary in the number of cells. If there are a number of cells fewer than the number of cells in the header row, empty cells are inserted. If there are greater, the excess is ignored.