It is currently impossible (AFAIK) to mark up an inline code element that contains a backtick while using backticks as delimiters. Escaping the middle backtick doesn't work: ##`foo\`bar`.## results in the second backtick closing the code span, It's also not possible to use three backticks //inside// code blocks,i.e. since they conflict with the wrappers of the code blocks themselves.the backslash+backtick sequence doesn't escape the backtick at all:
Note: the first issue can be bypassed by using the other code formatting delimiter{F2979244}
Using multiple backticks for an inline code span is not supported either — doing ##``foo`bar``## results in:
{F2979247}
~~It's also not possible to use three backticks //inside// code blocks, since they conflict with the wrappers of the code blocks themselves~~ Actually, `#`:this seems to work as long as the inner triple-backticks don't appear by themselves in a single line:
```
Lorem ##foofoo```bar## ipsum
```
Note: the first issue can be bypassed by using the other code formatting delimiter, `#` — in particular, doing
```
Lorem ##foo`bar## ipsum
```
...results in "Lorem ##foo`bar## ipsum"in:
{F2979252}
(Using `#` characters is how I wrote the source for the examples above). But that is clunky, and hard to figure out. It also does not fix the issue n't work for triple backticks within code blocks, and relies on using two characters simultaneously for the same effectsince the latter can't be created with `###` as delimiters.
Markdown (well, CommonMark) also [[https://spec.commonmark.org/0.30/#example-338 | has this limitation]], but works around it by allowing multiple backticks to be used in code spans and blocks: two backticks at the edgessurrounding a code span to allow a single backtick inside it; three around to allow double backticks inside; and so on. The same is [[https://spec.commonmark.org/0.30/#example-124 | true for code blocks]]: if three backticks are needed inside (even if standing on a line by themselves), then the whole block iscan be wrapped with four backticks, and so on.
So**In summary**: the request here is to implement support for code spans wrapped with double backticks or more, and code blocks wrapped with four backticks or more.
(One small benefit of this change is that one cit would thenbecome possible to use two characters for code blocks (even if they don't contain backticks) so as to, which would make the syntax more consistent with the other delimiters that also use doubled characters.)