Skip to content

Add a type property to the def tokenizer's return object - again#2002

Merged
UziTech merged 1 commit intomarkedjs:masterfrom
sapristi:patch-1
Apr 11, 2021
Merged

Add a type property to the def tokenizer's return object - again#2002
UziTech merged 1 commit intomarkedjs:masterfrom
sapristi:patch-1

Conversation

@sapristi
Copy link
Copy Markdown
Contributor

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.

Marked version:

2.0.2

Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a

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.

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.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 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/2pE1NqmTB6cUXBsSYJXHUvGDiANC
✅ Preview: https://markedjs-git-fork-sapristi-patch-1-markedjs.vercel.app

Copy link
Copy Markdown

@RonSherfey RonSherfey left a comment

Choose a reason for hiding this comment

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

change1

@calculuschild
Copy link
Copy Markdown
Contributor

LOL how did we all miss that.

@UziTech UziTech merged commit 47e65cf into markedjs:master Apr 11, 2021
github-actions bot pushed a commit that referenced this pull request Apr 11, 2021
## [2.0.3](v2.0.2...v2.0.3) (2021-04-11)

### Bug Fixes

* actually add a `type` property to the `def` token ([#2002](#2002)) ([47e65cf](47e65cf))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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