Skip to content

GFM: How to include code for a fenced code block inside a fenced code block? #456

@LeaVerou

Description

@LeaVerou

The GFM spec includes multiple strategies for this, none of which seem to work with Showdown.

  • "The closing code fence must use the same character as the opening fence:": Tildes don't seem to be supported
  • "The closing code fence must be at least as long as the opening fence": Using more than three backticks doesn't seem to be supported
  • I tried backslash escaping, that didn't work either.

Is there any way to do this?

(code below for attempt number 2: using different number of backticks)

## Demo

````markup
<div mv-app mv-storage="local" 
     mv-plugins="markdown">
	<div property="text" class="markdown">### Heading
**This is bold** *This is italic* 
Here’s a [link!](https://mavo.io)

And some code:

```js
	foo.bar();
```
	</div>
</div>
````

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions