-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Enable syntax highlighting for inline code #134
Comments
@gjtorikian brings up a valid concern.
Maybe we add a context option for tags to syntax highlight, and the default option is a Once one or many tags can be searched, benchmarks could be performed. Thoughts? |
The more I think about this the harder it becomes. Linguist uses file extensions and text analysis to determine how to highlight a file. A few tokens might not be enough to determine how code should be colored. (This is all just a pessimistic guess, though.) |
It's an interesting suggestion, but I'm going to say no to this feature. When using multi-line fenced code blocks, the user can explicitly specify the language for us to highlight. For inline blocks, we'd have to guess what the language is. There will be lots of ambiguity if it's only a few tokens, and if an inline phrase is used, then it's likely to be short. This would increase the time to render, and give potential bad highlights. |
Copying from this issue from
github/markup
:Currently, you can syntax-highlight code blocks. For example,
renders as
However, you cannot do the same with inline code such as
main :: IO ()
or
main :: IO ()
both of which get rendered as
main :: IO ()
(without syntax highlighting) when used inline. It would be nice to have something likehaskell main :: IO ()
that gives you inline syntax-highlighting (right now, that would render as
haskell main :: IO ()
).As gjtorikian suggested on the other issue, this could conceivably be fixed by changing this line to match on
code
tags, as well aspre
.The text was updated successfully, but these errors were encountered: