-
Notifications
You must be signed in to change notification settings - Fork 353
Update markdown-related packages #497
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
Conversation
⚠️ No Changeset found
Latest commit: 990d677
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@remcohaszing
remcohaszing
left a comment
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 added some tips, but really the tools you’re currently using are fine as-is too. :)
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.
Should you support GFM and/or frontmatter here? Is so, you should use remark-gfm / remark-frontmatter.
Unless you need options passed into the function, I recommend to define the processor once outside of the function. This way plugins can cache some of the heavy lifting. This isn’t really applicable to your case, but IMO it’s a good practice. If you use GFM/frontmatter, this also allows you to keep the processor in sync with the stringify processor you use below.
const processor = unified() .use(remarkParse) .use(remarkFrontmatter) .use(remarkGfm) .use(remarkStringify) // ... let ast = processor.parse(changelog)
If you don’t want any of that, the remark abstractions don’t really offer much. You might as well use the slightly lower level mdast-util-from-markdown and mdast-util-to-markdown.
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.
Thanks for the review! ❤️
cc @remcohaszing, maybe you'd have a sec to double-check if I'm using the most kosher tools here? 😅