How to change the way Fenced Code recognize language

Hi all,

Currently, I’m using a plugin call markdown-it-named-code-block to add title to a Code Block through a syntax like this:
```js:hello.js
console.log(‘hello world’)
```
But I’m running into a bit of issue as codemirror does not recognize the language so no highlighting, I think it is because of the additional text after ‘js’.

I hope anyone can provide me with guidance on this problem as I can not find a helpful answer in the docs

On a sidenote as I writing the code block above, it actually can recognize the language so I have to use \ to escape. That exactly what I want to achieve and I wonder how you guys can do that.

I wish you all to have a nice day and happy coding.

Does the patch below look like it would solve this for you?

2 Likes

By the look of it, it would certainly help, but I haven’t been able to test it. Because I can not find a way to apply your code to the node_module of my project.

I very much appreciate the help ( whooh and the speed of it). Can you show me the way how can I use the code above, or can you make a new release out of it

I’ve tagged a version 0.20.1 of lang-markdown.

1 Like

I got it now, thank a lot for your work