MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

`parsed-literal` does not preserve code-highlighting

Open LecrisUT opened this issue 6 months ago • 2 comments

I am not sure if this is a bug or documentation issue. Basically I saw CMake's documentation that uses parsed-literal, and I wanted to port that design to my myst documentation. But I cannot get the code-highlighting to detect the language correctly. I don't know if there is a specific that should be enabled for that or is this specific to RST?

LecrisUT avatar Jan 02 '24 19:01 LecrisUT

But I cannot get the code-highlighting to detect the language correctly

Heya, I'm a bit confused what you mean by this? parsed-literal will parse the containing block as MyST, it is not for code highlighting: https://docutils.sourceforge.io/docs/ref/rst/directives.html#parsed-literal-block

chrisjsewell avatar Jan 12 '24 00:01 chrisjsewell

From what I've read on forums it is only supposed to parse its known markups like the links. For myst, it does do that, but steadily then the code highlighting is lost.

Alternatively would it be possible to code something to markup only markdown links (reference style links or autolinks might be tricky) and pass everything else to either code-highlight parser?

LecrisUT avatar Jan 12 '24 06:01 LecrisUT