Skip to content
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

Add a type property to the def tokenizer's return object #2001

Merged
merged 1 commit into from
Apr 10, 2021
Merged

Add a type property to the def tokenizer's return object #2001

merged 1 commit into from
Apr 10, 2021

Conversation

sapristi
Copy link
Contributor

@sapristi sapristi commented Apr 9, 2021

Related to #2000

Marked version:

2.0.1

Markdown flavor: all

Description

Expectation

Markdown nodes all have a type property to ease working with the markdown tree.

Result

def nodes do not have a type property.

What was attempted

Using walkTokens in typescript, I have the need to discriminate between nodes; the https://www.npmjs.com/package/@types/marked package doesn't define a type member for the Def interface, seemingly because there is not one here either.

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel
Copy link

vercel bot commented Apr 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/markedjs/markedjs/4w5nnEqsuVHCgKGHPEwGncfHwnVd
✅ Preview: https://markedjs-git-fork-sapristi-patch-1-markedjs.vercel.app

@UziTech
Copy link
Member

UziTech commented Apr 9, 2021

@styfle @calculuschild would this be a breaking change?

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

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

LGTM

@calculuschild
Copy link
Contributor

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.

Copy link
Member

@styfle styfle left a 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

@UziTech UziTech merged commit 009427f into markedjs:master Apr 10, 2021
github-actions bot pushed a commit that referenced this pull request Apr 10, 2021
## [2.0.2](v2.0.1...v2.0.2) (2021-04-10)

### Bug Fixes

* add type property on def token ([#2001](#2001)) ([009427f](009427f))
@github-actions
Copy link

🎉 This PR is included in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sapristi sapristi deleted the patch-1 branch April 10, 2021 21:14
@sapristi
Copy link
Contributor Author

Thanks !

UziTech pushed a commit that referenced this pull request Apr 11, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set type member for all nodes
4 participants