Skip to content

Indented fenced code blocks not highlighting in lists #2177

@christhekeele

Description

@christhekeele

Per elixir-makeup/makeup#71:

The correct way (AFAIK) to include a fenced code block (or anything) in a multi-line list item in markdown is by indenting it in between 3 and 7 spaces (I usually go for 4):

- A list

- with bullets

    with multiple lines

- deeply indented

  - nested bullets

    - don't turn into code
    
      - even if you hit
        
        - 8 spaces

          like so

- and fenced code blocks

    ```elixir
    similarly indented
    ````

This (correctly) renders as:

  • A list

  • with bullets

    with multiple lines

  • deeply indented

    • nested bullets

      • don't turn into code

        • even if you hit

          • 8 spaces

            like so

  • and fenced code blocks

    similarly indented

However, at least in EXTRAs in my ex_doc projects, I do not get syntax highlighting for mildly indented code blocks in lists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions