-
Notifications
You must be signed in to change notification settings - Fork 47
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
Syntax highlighting broken with minted inline #113
Comments
The problem is the mintedinline command is not accounted for, so it defaults to the generic macro highlighting. This does not take arguments, so what follows is considered regular text. Solution would be to add something along the lines of the following to the latex grammar file
Seems easy enough to do, question is if there is anybody maintaining this package @yudai-nkt ? |
Yep, we currently don't provide a grammar for |
@yudai-nkt I'm working on this now, but I'm not sure what scopes to use. The general syntax for this command is as follows (taken from minted manual):
The delimiters and code I would treat like verbatim, so I'm trying to match that style. It's the optional arguments, language, and overall scopes I'm not sure about. Aside from that though, the following (normal) regex seems to work well (https://regex101.com/r/U5RnJ9/1)
First the The other problem is bracket matching, as it allows unbalanced brackets in the optional and language scopes, but I don't think this package handles that anyway. |
The following example breaks the double compute (int n) {
for (int i=0; i<n; ++i) {
double x = Math.sqrt(i)
}
} If I had a semicolon at the end of the line within the for loop, then we are fine, but I shouldn't have to do this. |
@natestemen This issue is for minted inline, not the minted environment. If you have an issue with the minted environment, please open a new issue and give a minimum (not) working example that someone can copy and paste into Atom to immediately see the problem. As it stands, I cannot replicate your issue. |
I can't come up with a concrete example because I don't fully remember all the options in the @natestemen I actually reproduced your problem but this issue is not the place to discuss yours. So please make a new issue with a reproducible LaTeX (not Java) code example if this is really a |
@yudai-nkt That was because I like to have broken things be shown by the syntax before compiling (within reason). There is no real reason to expect unbalanced brackets. However, something like \mintinline{{python}+def minted()+ will appear fine, but will not compile because there are two opening |
I get your point and the simplicity definitely outweighs the risks. I have one favor to ask of you; as in the "Unification of backslash and letters in pattern matching" section in yudai-nkt/language-tex#10, I prefer (I should export some of the issue from language-tex to here.) |
The minted package for code listings has a command
mintedinline
for inlining code. Syntax highlighting breaks for me when dollar signs or backticks are present in the inlined code, e.g.\mintinline{javascript}{$(".jquery-stuff")}
. I suspect the issue is similar to #75 and would have a similar solution.The text was updated successfully, but these errors were encountered: