-
Notifications
You must be signed in to change notification settings - Fork 40
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
New lexer for syntax-highlighting #33
Conversation
…t traversal of the AST. The new lexer allows styling nested Markdown based on the innermost AST node.
Refactored MarkdownTokenListBuilder to simplify testing.
…own extensions over standard Markdown.
New lexer for syntax-highlighting
Hi, This is a huge step towards a mature lexer! Thanks for your effort! I only did a quick review - but I will already merge the changes and test if my work lets me ;). |
@stengerh Until now - the master branch was always also the stable branch. With this merge it is more "experimental". Since we have the tags as releases I do not mind specifically to change this procedure. Do you prefer an extra "experimental" branch? Also: Some things already work some don't. Should I create issues for my findings? |
I agree on the experimental nature of this change. While I have done enough testing to convince myself that the code is reasonably robust, it does change the user experience. I am not sure yet whether we should have an experimental branch. However I would like to have some kind of nightly or preview build to get feedback from the users about new features. Yes, please create issues if you find anything strange or broken. |
I have experimented with a new lexer which is based on a depth-first, left-to-right traversal of the PegDown AST. The lexer has the following properties:
The last one is a change from the current behaviour but could be easily changed if desired by the users. Please see the example below which illustrates the highlighting in the editor.
Markdown source:
HTML as rendered by PegDown:
Highlighting with old lexer:
Highlighting with new lexer: