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

Fix fenced code blocks #1073

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Conversation

jemiam
Copy link
Contributor

@jemiam jemiam commented Dec 18, 2023

When triple backticks are in results for terraform command, wrapCode method uses HTML tags(pre + code) to escape it. But currently these tags are also escaped so it doesn't work as intended.

image

This PR fixes the bug by

  • When triple backticks are not in results, use triple backticks
  • When only triple backticks are in results and triple tilde not in results, use triple tilde
  • When both triple backticks and triple tilde are in results, use pre + code tags without HTML escape

@suzuki-shunsuke
Copy link
Owner

Thank you for your contribution!

@suzuki-shunsuke suzuki-shunsuke added the bug Something isn't working label Dec 18, 2023
@suzuki-shunsuke
Copy link
Owner

@jemiam
Copy link
Contributor Author

jemiam commented Dec 18, 2023

Forgot to add nolint:gosec comment 🙂

@suzuki-shunsuke
Copy link
Owner

Thank you!

@suzuki-shunsuke suzuki-shunsuke merged commit 5474748 into suzuki-shunsuke:main Dec 18, 2023
8 checks passed
@suzuki-shunsuke suzuki-shunsuke added this to the v4.7.3 milestone Dec 18, 2023
@jemiam jemiam deleted the fix/wrap-code branch December 19, 2023 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants