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 component defined in extends not rendered as Markdoc tags/nodes #11846

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Aug 27, 2024

Changes

This PR fixes an issue where rendering Astro components as Markdoc tags and nodes when configured using the extends property would lead to an error (Unable to render [object Object]. No valid renderer was found for this file extension.).

This would prevent for example Starlight users to have a configuration like this:

export default defineMarkdocConfig({
  extends: [starlightMarkdoc()]
  tags: {
    custom: { render: component('./src/components/Custom.astro') },
  },
});

The issue was that when creating the component configs for used tags and nodes, the user-defined Markdoc config was used instead of the computed one that also contains the merged configurations from the extends property.

Testing

I mostly duplicated the existing test/fixtures/render-with-components fixture and its associated test/render-components.test.js tests and created a fixture where the configuration is done using extends.

Docs

This is a bug fix for a feature that does not have a specific documentation or example.

Copy link

changeset-bot bot commented Aug 27, 2024

🦋 Changeset detected

Latest commit: 0bab683

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 pkg: integration Related to any renderer integration (scope) label Aug 27, 2024
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Thank you!

@ematipico ematipico merged commit ed7bbd9 into withastro:main Aug 27, 2024
14 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants