-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Recognize [console] and [bash session] as cram test code blocks #372
Comments
console] and [
bash session] as cram test code blocks\
\console] and [\
\\
bash session] as cram test code blocks
\
\console] and [\
\\
bash session] as cram test code blocks\
\console} and {\
\\
bash session} as cram test code blocks
\
\console} and {\
\\
bash session} as cram test code blocks
I think it's not properly documented atm but there are labels you can use to force the type of a block in MDX. In that case you could force MDX to interpret those blocks as cram blocks. You should be able to write: That's a cram block underneath:
<!-- $MDX cram -->
```console
...
``` Explicitly stating the type of the block is good practice as it helps MDX with error reporting as you know you and MDX agree on the type of block, which might not be the case when you let MDX guess it from the language token and the syntax inside the block. We can also add support for those language tags in cram blocks but in the meantime I'd advise you use this explicit declaration approach! |
Thanks! But that approach has a problem ... all code blocks
are changed to the following during
|
Ah, that's a bug indeed! Sorry for the inconvenience, we'll look into it! |
Any word on a fix for this? It’d be nice to get proper syntax highlighting on Github by using |
Root Problem
The ```sh``` code blocks that are supported and documented for cram tests are not actually
sh
blocks.Context
A
sh
block is:A
console
block (at least in GitHub Flavored Markdown) is:But labeling
console
blocks assh
blocks misrenders the block:Proposed Fix
Recognize the tokens
console
andbash session
(GitHub Flavored Markdown)) in addition tosh
as cram test code block tokens.Hacky mitigation today
https://github.com/diskuv/diskuvbox/blob/62da4c3fc269bb707a5d71752e673baa1e207d00/dune#L9-L34
The text was updated successfully, but these errors were encountered: