Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Code "lang", which is part of a list, is not considered #625

Open
1 of 2 tasks
szotsaki opened this issue Nov 16, 2021 · 0 comments
Open
1 of 2 tasks

Code "lang", which is part of a list, is not considered #625

szotsaki opened this issue Nov 16, 2021 · 0 comments

Comments

@szotsaki
Copy link

Type

  • bug
  • feature request

When we have a list and inside it a Prism.js code section (```) fusuma doesn't add its language to the loadable list of languages.

Here is an example:

# Header

* First line
* Second line
    ```
    Code without language
    ```
    ```diff
    --- file1.txt   2018-01-11 10:39:38.237464052 +0000
    +++ file2.txt   2018-01-11 10:40:00.323423021 +0000
    @@ -1,4 +1,4 @@
    cat
    -mv
    -comm
    cp
    +diff
    +comm
    ```
* Third line
    * Fourth line
        ```diff
        --- file1.txt   2018-01-11 10:39:38.237464052 +0000
        +++ file2.txt   2018-01-11 10:40:00.323423021 +0000
        @@ -1,4 +1,4 @@
        cat
        -mv
        -comm
        cp
        +diff
        +comm
        ```

This is valid markdown where code sections are indented to the list level. Rendered by github:

  • First line
  • Second line
    Code without language
    
    --- file1.txt   2018-01-11 10:39:38.237464052 +0000
    +++ file2.txt   2018-01-11 10:40:00.323423021 +0000
    @@ -1,4 +1,4 @@
    cat
    -mv
    -comm
    cp
    +diff
    +comm
  • Third line
    • Fourth line
      --- file1.txt   2018-01-11 10:39:38.237464052 +0000
      +++ file2.txt   2018-01-11 10:40:00.323423021 +0000
      @@ -1,4 +1,4 @@
      cat
      -mv
      -comm
      cp
      +diff
      +comm

The problem is that diff is not syntax coloured on the slide (but it is here above).

The reason is in mdx-loader/src/mdxPlugin.js tree.children.forEach() only processes top-most code types but doesn't descent deeper (e.g. into a list type).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant