-
Notifications
You must be signed in to change notification settings - Fork 60
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 basic support for syntax highlighting in code blocks #515
Conversation
f6922b3
to
956a219
Compare
Added workaround to alecthomas/chroma#716 for now. |
b2cd02d
to
d1782d1
Compare
d1782d1
to
ee4cebb
Compare
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.
That looks pretty cool :)
Some small remarks:
- not necessary for this PR, but for the next PR I think it's maybe better to move the codeblock handling to a separate method.
- what are your thoughts about instead of making 3 extra options using just one like eg SyntaxHighlighting="formatter:style" if it's empty it's not used and otherwise get the formatter/style out of it ?
Sounds good, updated PR implementing this - 3 extra options down to just one. Thanks for your review. |
c362da3
to
e0d5ccd
Compare
Okay, ready to go / review. Thanks and much appreciated. |
7571b49
to
328251d
Compare
328251d
to
7625bd2
Compare
b066e4f
to
7625bd2
Compare
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.
LGTM
As it is right now, it will only use syntax highlighting on code blocks where it specifies syntax highlighting, that is ```blah. This is because it's a very basic implementation where we're doing per-line.
Ideally, we'll want to buffer up code block lines and then pass it through to https://github.com/alecthomas/chroma which will then analyse and try to determine what style to use if none provided.