-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve Markdown + Components usage #3410
Conversation
🦋 Changeset detectedLatest commit: 3285844 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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.
I'm not as familiar with some of the custom MD parsing logic updated here, but the test coverage looks good to me!
Marking this review as a comment rather than Approve in case anyone that's worked on the MD logic recently wants to chime in
let { data: frontmatter, content: markdownContent } = matter(source); | ||
|
||
// Turn HTML comments into JS comments | ||
markdownContent = markdownContent.replace(/<\s*!--([^-->]*)(.*?)-->/gs, (whole) => `{/*${whole}*/}`) |
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.
Nice 👏
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.
REMARK
ABLE WORK!
550db92
to
294a668
Compare
I have one question. Would this allow for components in markdown files that are placed elsewhere outside of the Otherwise this looks amazing, great work dude 💚💚💚 |
058e176
to
e2ef8e7
Compare
These changes don't touch our routing logic, just the markdown processing itself. Please open an issue detailing your use case so we can track this separately! |
c1e1a9a
to
7c28277
Compare
7c28277
to
3285844
Compare
* feat: use internal MDX tooling for markdown + components * fix: improve MD + component tests * chore: add changeset * fix: make tsc happy * fix(withastro#3319): add regression test for component children * fix(markdown): support HTML comments in markdown * fix(withastro#2474): ensure namespaced components are properly handled in markdown pages * fix(withastro#3220): ensure html in markdown pages does not have extra surrounding space * fix(withastro#3264): ensure that remark files pass in file information * fix(withastro#3254): enable experimentalStaticExtraction for `.md` pages * fix: revert parsing change * fix: remove `markdown.mode` option
Changes
@astrojs/markdown-remark
remark-mdx
, but doesn't use all of the features (namely inline esm imports)<p>
tags around ComponentsTesting
@astrojs/markdown-remark
astro
to reflect new and improved outputDocs
TODO