Skip to content
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

Setting source="console" is incompatible with result="ansi" #13

Closed
ssbarnea opened this issue Feb 1, 2023 · 1 comment
Closed

Setting source="console" is incompatible with result="ansi" #13

ssbarnea opened this issue Feb 1, 2023 · 1 comment

Comments

@ssbarnea
Copy link
Sponsor Contributor

ssbarnea commented Feb 1, 2023

Describe the bug

It seems that it is not possible to include ANSI output while still showing the command that was executed.

To Reproduce

```bash exec="1" result="ansi"
ansible-lint -t idempotency playbook.yml
```

```bash exec="1" source="console" result="ansi"
ansible-lint -t idempotency playbook.yml
```

Expected behavior

Use of result=ansi should not depend of value of source.

Screenshots

  • The first example renders ansi correctly but it does not include the command line.
  • The second example includes the command line executed but fails to render ANSI and adds some extra backticks which break the rendering.

Additional context
Add any other context about the problem here.

@pawamoy
Copy link
Owner

pawamoy commented Feb 1, 2023

This is actually a limitation and is documented here: https://pawamoy.github.io/markdown-exec/usage/#wrap-result-in-a-code-block.

The console style is also a syntax highlight option, so we can't have both console and ansi at the same time. But maybe Pygments provides another option like terminal which would combine both?

I can otherwise consider lifting the limitation up and force the use of the specified result option. The user decides after all.

pawamoy added a commit that referenced this issue Feb 18, 2023
@pawamoy pawamoy closed this as completed Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants