# Embedding backticks twice collapses whitespace

**URL:** https://meta.discourse.org/t/embedding-backticks-twice-collapses-whitespace/46171
**Category:** Bug
**Tags:** markdown-it-review
**Created:** [June 22, 2016, 8:23am UTC](https://meta.discourse.org/t/embedding-backticks-twice-collapses-whitespace/46171 "2016-06-22T08:23:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![precessor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/precessor/32/120664_2.png) [@precessor](https://meta.discourse.org/u/precessor)
#### Post date: [June 22, 2016, 8:23am UTC](https://meta.discourse.org/t/embedding-backticks-twice-collapses-whitespace/46171/1 "2016-06-22T08:23:12Z")

</div>

If I include preformatted text which has a backtick, twice, in a paragraph, whitespace is removed.

## Recap

Markdown to embed a backtick is double-backticks instead of single ones:

```
``embedded `backtick``

```

LIke this - text `embedded `backtick` text text.

## Repro like this

Include two embedded-backtick preformatted sections in a paragraph:

```
Text ``embedded `backtick`` text ``embedded `backtick`` text.

```

We get:

Text `embedded `backtick` text `embedded `backtick` text.

and some whitespaces collapse.

---

<div class="post-metadata">

### Author: ![Steven\_Arnott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven_arnott/32/42737_2.png) [@Steven\_Arnott](https://meta.discourse.org/u/Steven_Arnott)
#### Post date: [March 13, 2017, 4:16pm UTC](https://meta.discourse.org/t/embedding-backticks-twice-collapses-whitespace/46171/2 "2017-03-13T16:16:56Z")

</div>

White space handling for back ticks also has issue in the following case

```
`some text`/`some other text`

```

Causes all following back tick markup to collapse any surrounding white spaces like so:

`some text`/`some other text` - well lets see.  
`some more text`should have a space after`text`

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 26, 2017, 1:57pm UTC](https://meta.discourse.org/t/embedding-backticks-twice-collapses-whitespace/46171/3 "2017-06-26T13:57:10Z")

</div>

This now works per:

> [@CommonMark testing started here!](https://meta.discourse.org/t/commonmark-testing-started-here/65121):
>
> Per our [migration plans](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon), I just enabled [markdown.it](https://github.com/markdown-it/markdown-it) at Meta. It is an excellent [CommonMark](http://commonmark.org/) compliant engine. I expect quite a few edges to be found during this period of testing. Do not open bugs about the new Engine, just reply here. I/we will be updating the top post here with the list of issues and striking out stuff as it is fixed. Current known issues (to be fixed)white_check_mark Onebox vanishes after you start typing and works not-super consistently white_check_mark pending…

(rebaked OP to confirm)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 26, 2017, 1:57pm UTC](https://meta.discourse.org/t/embedding-backticks-twice-collapses-whitespace/46171/4 "2017-06-26T13:57:16Z")

</div>


