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 |
tony-sull
left a comment
There was a problem hiding this comment.
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}*/}`) |
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-remarkremark-mdx, but doesn't use all of the features (namely inline esm imports)<p>tags around ComponentsTesting
@astrojs/markdown-remarkastroto reflect new and improved outputDocs
TODO