Skip to content

Fenced code block as a list item #9865

Closed
@johnmapeson

Description

@johnmapeson

A bug report or maybe a request for improvement.

Sometimes it is necessary to have a fenced code block as a list item. As I have discovered, the proper syntax for this is not very intuitive.

pandoc input.md -o output.htm
- example 1
- ```
  list item two
  list item two
  ```
- list item three

In Example 1, each line inside the pre block is indented with two spaces, whereas I expected the lines won't be indented.

-   example 2
-   ```
    list item two

    list item two
    ```
-   list item three

Example 2 works fine, but ony if the two lines inside the pre block are separated with the empty one. If there is no empty line between them, the markup will be <li><code>list item two list item two</code></li>.

- example 3
- ```
list item two
list item two
```
- list item three

Example 3 demonstrates the syntax that works fine. Though we can use it, I would prefer the syntax from the Example 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions