-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add a type property to the def tokenizer's return object
#2001
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
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/markedjs/markedjs/4w5nnEqsuVHCgKGHPEwGncfHwnVd |
|
@styfle @calculuschild would this be a breaking change? |
UziTech
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.
LGTM
|
I don't see anything that would be breaking. I think adding information is usually ok; only if someone is depending on no type to detect def tokens but I doubt that is a common occurrence. LGTM. |
styfle
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.
Looks good 👍
Agreed, I don't think adding a new prop is considered breaking
## [2.0.2](v2.0.1...v2.0.2) (2021-04-10) ### Bug Fixes * add type property on def token ([#2001](#2001)) ([009427f](009427f))
|
🎉 This PR is included in version 2.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
Thanks ! |
Hmm I think I modified the wrong file (`lib/marked.js`) in the previous PR (see #2001) , this should be the right one ! Sorry for that.
Related to #2000
Marked version:
2.0.1
Markdown flavor: all
Description
typemember for all nodes #2000Expectation
Markdown nodes all have a
typeproperty to ease working with the markdown tree.Result
defnodes do not have atypeproperty.What was attempted
Using
walkTokensin typescript, I have the need to discriminate between nodes; the https://www.npmjs.com/package/@types/marked package doesn't define atypemember for theDefinterface, seemingly because there is not one here either.Contributor
Committer
In most cases, this should be a different person than the contributor.