yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
1.01k stars 206 forks source link

Problem escaping | character in table #310

Open tarockx opened 1 year ago

tarockx commented 1 year ago

Hello

I'm using the latest version of the plugin (v1.4.4) and I noticed an issue when rendering markdown tables.

Let's consider this markdown table for example:

|Param|Flags|
|-|-|
|param 1|valid flags: `first\|second\|third`|
|param 2|valid flags: `first\|second`|

As you can see, I'm using a backslash to escape the | characters that are part of the text and should not be considered as column separators. This is rendered correctly in the VS Code preview window and also on GitHub, here's how it looks like: image

however when generating a PDF with markdown-pdf the output I get is this:

image

As you can see, it is a bit weird: it incorrectly prints the backslashes as if they're part of the text, but at the same time it seems to be correctly escaping the | character because it is also printed instead of being interpreted as a column separator.

Any idea what is causing this? Is it a bug, or am I using the wrong syntax here?

Thanks!