-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Inline tokens #1627
Inline tokens #1627
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/markedjs/markedjs/qba5ws1f2 |
I wasn't sure about how to add the inline tokens to the tokens array. Some tokens (like lists and blockquotes) have other tokens inside of them already so they have
This PR currently does |
I'm not sure why travis ci isn't reporting but the tests are passing. travis ci log |
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 didn't review all the tests thoroughly but looks good! 🥇
@styfle what do you think about #1627 (comment)? |
I have rebased and implemented option 2 from #1627 (comment) It didn't make sense to keep the |
I renamed the lexer functions and reordered the parameters for the lexer so they are consistent. @styfle I think this is ready to merge if you approve. |
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.
Great work!
Hey @UziTech, thank you for the great work. |
@experimentalPrivateRepos We have a few more changes to get into the next release. I would estimate it will be about a month before the next release. |
@UziTech Alright, thank you for the quick response! |
Hi, since the |
Inline tokens
Description
Right now the
Lexer
returns the block tokens and theParser
sends the text to theInlineLexer
which sends the information to theRenderer
. There is no way to get the inline tokens before sending them to theRenderer
.This PR changes the
Lexer
to return all tokens with block tokens that have tokens inside of them in atokens
property on the token and changes theParser
to act on all tokens instead of the text from the block tokens.Each token that has inline or block tokens will have a
tokens
property that is an array of tokens.The
list
token will have anitems
property which will be an array of list items. Each list item will have atokens
property with the tokens inside the item.This PR also adds a
raw
property to the tokens so a user can get the markdown that created that token.fixes #1626
fixes #361
TODO:
Lexer
, andParser
lib/marked.js
) up even more.Contributor
Committer
In most cases, this should be a different person than the contributor.