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: use Shiki's isSpecialLang to allow ansi codeblocks #10540

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

imkunet
Copy link
Contributor

@imkunet imkunet commented Mar 24, 2024

Previously, there was a hardcoded if condition which detected unknown languages and replaced them with plaintext for codeblocks. Hardcoding this value makes it impossible to use Shiki's ansi feature. Changed the code from using the hard coded value over to using a library function, fixing #10539.

Changes

  • Instead of using the hard-coded check for an invalid language, use the built in function to do so.
  • Enables using the ansi language (as well as txt, text, etc.)

Before and after photos:

image
image

Testing

This change was tested by modifying the blog example locally (not tracked). Unit tests may not be necessary for change.

Docs

As this is a bug fix that only enables wrongly suppressed behavior, no documentation needs to be altered.

Hardcoding this value makes it impossible to use Shiki's `ansi` feature
Copy link

changeset-bot bot commented Mar 24, 2024

🦋 Changeset detected

Latest commit: cd3dd8b

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the feat: markdown Related to Markdown (scope) label Mar 24, 2024
@matthewp matthewp merged commit c585528 into withastro:main Mar 25, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: markdown Related to Markdown (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants