csvtomd-web icon indicating copy to clipboard operation
csvtomd-web copied to clipboard

Pipe characters are not escaped, breaking tables

Open vadcx opened this issue 2 years ago • 0 comments

Same issue as mzjp2/mdtable/issues/7, I will copy-paste the bug report below. Tested just now at https://csvtomd.com/


Input CSV (LibreOffice):

Header,HeaderC2,Header C3
Normal line,another,And the last
if (OK && GREAT),it works,as expected
If (ouch || bad),oopsie,doopsie

Output Markdown (mdtable input.csv > output.md)

| Header           | HeaderC2 | Header C3    |
| ---------------- | -------- | ------------ |
| Normal line      | another  | And the last |
| if (OK && GREAT) | it works | as expected  |
| If (ouch || bad) | oopsie   | doopsie      |

You can see the || characters are not escaped to \|\| thus producing a broken result (pasted below). Simply escaping the characters as shown works on Github.

Header HeaderC2 Header C3
Normal line another And the last
if (OK && GREAT) it works as expected
If (ouch bad)

vadcx avatar Apr 22 '23 09:04 vadcx