Skip to content

Add directives to mdast node type registry #2

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

Merged
merged 1 commit into from
Jul 28, 2021
Merged

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented Jul 28, 2021

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

When using this utility, the directive types will automatically be added
to mdast in the correct places.
See DefinitelyTyped/DefinitelyTyped#54421 for more information.

When using this utility, the directive types will automatically be added
to mdast in the correct places.
See DefinitelyTyped/DefinitelyTyped#54421 for more information.
@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jul 28, 2021
*/
function enter(type, token) {
// @ts-expect-error: custom node.
this.enter({type, name: '', attributes: {}, children: []}, token)
Copy link
Member Author

Choose a reason for hiding this comment

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

This really feels like magic and is awesome: because mdast-util-{to,from}-markdown use @types/mdast, and this package adds Directive nodes, this just starts working!

@wooorm wooorm added ☂️ area/types This affects typings 👍 phase/yes Post is accepted and can be worked on 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change labels Jul 28, 2021
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Jul 28, 2021
@github-actions

This comment has been minimized.

@wooorm wooorm merged commit ba997ce into main Jul 28, 2021
@wooorm wooorm deleted the node-type-registry branch July 28, 2021 13:17
@github-actions

This comment has been minimized.

@wooorm wooorm added the 💪 phase/solved Post is done label Jul 28, 2021
@github-actions github-actions bot removed the 👍 phase/yes Post is accepted and can be worked on label Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

1 participant