- edited description
Code Inside List item with ``` does not work great
Issue #21
new
Can you fix it?
- This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
javascript function helloWorld(){ console.log("hello World"); }
Because works only this way:
- This is a numbered list.
- I'm going to include a fenced code block as part of this bullet:
function helloWorld(){ console.log("hello World"); }
the code
Can you fix it?
1. This is a numbered list.
2. I'm going to include a fenced code block as part of this bullet:
```javascript
function helloWorld(){
console.log("hello World");
}
```
Because works only this way:
1. This is a numbered list.
2. I'm going to include a fenced code block as part of this bullet:
function helloWorld(){
console.log("hello World");
}
Comments (3)
-
reporter -
Account Deactivated I've been having issues with this as well. The triple-backtick code blocks work fine when at the root level of the document, but chokes when embedded within a list. Furthermore, if you try to insert a non-indented code block within an ordered list, it will break the list's numbering.
Take the following:
- Here's my numbered list
- I'm putting code within it:
javascript function helloWorld(){ console.log("hello World"); }
- but it displays oddly.
And the version with the un-indented code block:
- Here's another numbered list
- I'm putting code within it:
function helloWorld(){ console.log("hello World"); }
- The code displays acceptably, but breaks my list.
Source:
1. Here's my numbered list 2. I'm putting code within it: ```javascript function helloWorld(){ console.log("hello World"); } ``` 3. but it displays oddly. And the version with the un-indented code block: 1. Here's another numbered list 2. I'm putting code within it: ```javascript function helloWorld(){ console.log("hello World"); } ``` 3. The code displays acceptably, but breaks my list.
-
I second this! And I would like to point out that Github is able to properly render this type of Markdown syntax. So it's definitely do-able.
- Log in to comment