Describe the bug
Executed problems can produce ANSI output, which mkdocs can render using the ansi pygments formatter.
Still, this plugin does not allow us to specify which formatter to use and uses markdown.
This means that two undesired things will happen when documenting program output:
- if the output contains ANSI, the rendering will be messed
- if the output is plain text, some random keywords will be highlighted in the output
To Reproduce
Steps to reproduce the behavior:
- Gran a CLI tool that produces ANSI output, like ANSI test file
- Add a markdown-exec block the runs it
- What the rendered output.
Expected behavior
We need to allow exec to work similarly to already valid ANSI formatter
```ansi
```
Note that while testing, you might miss to see the colors but the ANSI will render fine. If you use inspect, you will see that class colors were added to the HTML and they will render once you add the extra css needed for them.
Screenshots
Example of an ANSI test file using the block above:

Example of undesired markdown coloring on a command line output:

Example of failure to process ANSI escapes:

System (please complete the following information):
Markdown Exec version: 1.0.0
- Python version: 3.11
- OS: MacOS
Additional context
I did observe that there is already support for recognizing the output as JSON or HTML, so I guess it should not be too hard to add an option where we can declare the expected output format, so it would render correctly.
If you could give some hints on how this can be addressed, I would be happy to contribute a PR. I was quite pleased about the current plugin behavior and its really good documentation.
Describe the bug
Executed problems can produce ANSI output, which mkdocs can render using the
ansipygments formatter.Still, this plugin does not allow us to specify which formatter to use and uses markdown.
This means that two undesired things will happen when documenting program output:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We need to allow exec to work similarly to already valid ANSI formatter
Note that while testing, you might miss to see the colors but the ANSI will render fine. If you use inspect, you will see that class colors were added to the HTML and they will render once you add the extra css needed for them.
Screenshots
Example of an ANSI test file using the block above:
Example of undesired markdown coloring on a command line output:

Example of failure to process ANSI escapes:

System (please complete the following information):
Markdown Execversion: 1.0.0Additional context
I did observe that there is already support for recognizing the output as JSON or HTML, so I guess it should not be too hard to add an option where we can declare the expected output format, so it would render correctly.
If you could give some hints on how this can be addressed, I would be happy to contribute a PR. I was quite pleased about the current plugin behavior and its really good documentation.