# Backslash treatment inside backquotes is different between Jekyll and Markdown

**URL:** <https://talk.jekyllrb.com/t/backslash-treatment-inside-backquotes-is-different-between-jekyll-and-markdown/8537>\
**Category:** Help\
**Created:** [September 14, 2023, 7:48am UTC](https://talk.jekyllrb.com/t/backslash-treatment-inside-backquotes-is-different-between-jekyll-and-markdown/8537 "2023-09-14T07:48:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveKriewall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/davekriewall/32/5514_2.png) [@DaveKriewall](https://talk.jekyllrb.com/u/DaveKriewall)\
**Post date:** [September 14, 2023, 7:48am UTC](https://talk.jekyllrb.com/t/backslash-treatment-inside-backquotes-is-different-between-jekyll-and-markdown/8537/1 "2023-09-14T07:48:18Z")

</div>

It appears that Jekyll’s markdown-to-HTML converter retains backslashes inside backquotes. But regular markdown (e.g. at [https://markdownlivepreview.com/](https://markdownlivepreview.com/)) interprets them.

For example, here is a raw markdown table definition. The “Type” cell contains the string “`string \| undefined`”. Note that there is a backslash before the vertical bar in the unprocessed markdown:

```auto
| Property | Type |
| -------- | ---------------------- |
| `pdfid` | `string \| undefined` |

```

This forum’s markdown viewer removes the backslash:

| Property | Type |
| --- | --- |
| `pdfid` | `string | undefined` |

The same thing happens when viewed by the [markdownlivepreview.com](http://markdownlivepreview.com) viewer. (I cannot paste an image of it here; as a new user, I’m limited to pasting only one image in my first post. But you can go to that site and paste the raw table definition into the left pane, and see the result.)

But when Jekyll converts it, the type of “pdfid” looks like this:  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/2/26fc770ebeb6729c2c98c25a4014025ff782df4a.png)

I think the backslash should be interpreted, even inside backquotes. Is this a bug in Jekyll, or in some markdown converter that Jekyll uses?

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [September 14, 2023, 3:15pm UTC](https://talk.jekyllrb.com/t/backslash-treatment-inside-backquotes-is-different-between-jekyll-and-markdown/8537/2 "2023-09-14T15:15:07Z")

</div>

This non-sensical behavior of pipe-code-spans inside tables is clearly a bug, but it has been formalized/frozen in the [Github-Flavored Markdown spec](https://github.github.com/gfm/#tables-extension-). Unfortunately, Jekyll’s default Markdown processor, Kramdown, tries to emulate all the quirks of GFM (via [parser-gfm](https://github.com/kramdown/parser-gfm)), but it misses this particular bug.

One immediate workaround is to use the [CommonMark processor](https://github.com/jekyll/jekyll-commonmark), which does appear to emulate the bug correctly.

---

<div class="post-metadata">

**Author:** ![DaveKriewall](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/davekriewall/32/5514_2.png) [@DaveKriewall](https://talk.jekyllrb.com/u/DaveKriewall)\
**Post date:** [September 15, 2023, 4:35am UTC](https://talk.jekyllrb.com/t/backslash-treatment-inside-backquotes-is-different-between-jekyll-and-markdown/8537/3 "2023-09-15T04:35:29Z")

</div>

Thanks, Chuck. I switched to CommonMark, and the backslashes are gone. But now mermaid diagrams don’t draw! Instead, I get

![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/e/e34137f30552f32321eae401fc208eb4192021c5.png)

The mermaid diagram is written as a code block, introduced with three backticks followed by the text “mermaid”. Kramdown displayed it properly.

I will investigate that issue separately, since it’s not a Jekyll problem per se. I consider this thread solved.
