Open szotsaki opened 2 years ago
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:
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
The problem is that diff is not syntax coloured on the slide (but it is here above).
diff
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).
mdx-loader/src/mdxPlugin.js
tree.children.forEach()
code
list
Type
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:
This is valid markdown where code sections are indented to the list level. Rendered by github:
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-mostcode
types but doesn't descent deeper (e.g. into alist
type).