-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Return html when render markdown content #6097
Conversation
🦋 Changeset detectedLatest commit: 845f308 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Thanks @bluwy! Yes, apologies for not detailing a use case on the ticket. The primary utility is RSS feeds, where you may want to the As for docs updates, I'd expect to:
I'd leave the Content Collections guide page alone looking at what it includes today. We can always update later if support tickets prove anything is unclear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! Just nits on the changeset and about a potential unit test
Makes sense! Thanks for the explanation. I'll update the docs later for no2, and set up the unit test. |
Is there any concern about introducing this API before we can offer something similar for MDX? Is the intention that we might one day figure this out for MDX too? Render components but exclude scripts & styles? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
After further discussion with the maintainers, we decided to close this for now until we have a proper way to expose |
I would really like to have this feature for my RSS feed (I don't use mdx at all). Wouldn't it be reasonable to make For now I have to use Edit: having to introduce another dependency for markdown rendering as recommended by the docs feels wrong (since a markdown renderer is already used internally) |
So why isn't |
@OverflowCat In short, because MDX needs to be "executed" as Astro components, and we need an API to safely render Astro components to strings of HTML. This is being tracked here! |
Changes
When
render()
a markdown file (not MDX), return thehtml
too.Implements this feature for better RSS composing experience.
Testing
Added new tests to make sure it renders
Docs
html
to RSS guide docs#2545