-
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
Split Lexer into extendable functions #1632
Conversation
List, NPTable, and Table functions slightly rewritten to remove need to access "src" variable within the functions (i.e. no "Backtracking" steps)
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/markedjs/markedjs/5z6k4mrtb |
This is my initial attempt at splitting the Lexer into extendable functions for each Markdown feature. Passes all tests, no noticeable slowdown through benchmark (that I can see). Each function returns Every function is passed So, further questions:
|
I am working on getting the InlineLexer to output tokens as well in PR #1627 maybe you want to build on that PR to allow the inline tokens (e.g strong, em ,link, etc.) to be extendable as well. |
@UziTech Is that PR pretty stable where it is? Do I just check out a new branch based on that PR? |
I'm thinking the easiest way for users to be able to extend the lexers would be to create a The user could modify the |
Ok, so let me make sure I have this right:
If this makes sense to you I can use #1627 as the starting point for this. |
I think it would be better if the function returns the token if it is successful and alters It might be easier if we just collaborate on #1627 together than trying to make two PR's to marked. You can contribute to that PR by sending PRs to the UziTech/marked/inline-tokens branch |
Gotcha. Misread your earlier post. Ok. I can work on that branch. |
Superseded by #1637 . |
List, NPTable, and Table functions slightly rewritten to remove need to access "src" variable within the functions (i.e. no "Backtracking" steps)
Marked version:
8.2
Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a
Description
Contributor
Committer
In most cases, this should be a different person than the contributor.