Skip to content

Allow Code Component to have custom props and extra class styles#9960

Merged
ematipico merged 30 commits into
withastro:mainfrom
StandardGage:9009
Mar 8, 2024
Merged

Allow Code Component to have custom props and extra class styles#9960
ematipico merged 30 commits into
withastro:mainfrom
StandardGage:9009

Conversation

@StandardGage

Copy link
Copy Markdown
Contributor

Changes

Allows Astro's Code component to use custom props, including extra classes. Attempts to fix #9009

Testing

Used Minimal example to test changes. Specifically tested using the issue description and also tested with inline set to true.

Docs

I don't believe docs would be needed.

@changeset-bot

changeset-bot Bot commented Feb 3, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c3ca52d

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 feat: markdown Related to Markdown (scope) pkg: astro Related to the core `astro` package (scope) labels Feb 3, 2024
Comment thread .changeset/calm-bags-deliver.md Outdated
Comment thread packages/astro/components/Code.astro Outdated
StandardGage and others added 2 commits February 3, 2024 17:06
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Comment thread packages/astro/components/Code.astro Outdated

@florian-lefebvre florian-lefebvre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

Comment thread packages/astro/components/Code.astro Outdated
Comment thread packages/markdown/remark/src/shiki.ts Outdated
Comment thread packages/markdown/remark/src/shiki.ts Outdated
@StandardGage

Copy link
Copy Markdown
Contributor Author

Hey @florian-lefebvre I've added your suggestions. You can see in the above comments the issues I found. I'm also suddenly having issues building so I don't have a great way of testing.

@florian-lefebvre

Copy link
Copy Markdown
Member

Don't worry about the failing tests called CI / Test for now, it has been caused by another PR

Comment thread packages/markdown/remark/src/shiki.ts Outdated
Comment thread packages/markdown/remark/src/shiki.ts Outdated
@florian-lefebvre

Copy link
Copy Markdown
Member

Hey @StandardGage are you still interested in this PR?

@StandardGage

Copy link
Copy Markdown
Contributor Author

Hey @florian-lefebvre , I haven't had much time to finish this PR so if it needs to be closed I understand and hopefully once I get more time I can open a new request towards this issue.

@ematipico ematipico added the semver: minor Change triggers a `minor` release label Feb 26, 2024
@florian-lefebvre

Copy link
Copy Markdown
Member

No worries, thanks for the initial effort! We'll take it from here

@florian-lefebvre florian-lefebvre self-assigned this Feb 26, 2024
Comment thread packages/markdown/remark/src/shiki.ts Outdated

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@ematipico

Copy link
Copy Markdown
Member

@florian-lefebvre and @bluwy, do you know if we need to update some documentation somewhere? I found only this page that mentions the Code component: https://docs.astro.build/en/reference/api-reference/#code-

@ematipico ematipico added this to the 4.5 milestone Feb 27, 2024
@florian-lefebvre

florian-lefebvre commented Feb 27, 2024

Copy link
Copy Markdown
Member

I think that's the only place. Tbh, people kinda expected additional props to work already so it feels more like a patch. VSC will show the types anyway so I think we don't need to update the docs

@sarah11918 sarah11918 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for docs!

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) pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Astros Code component ignores class:list attribute

5 participants