-
Notifications
You must be signed in to change notification settings - Fork 743
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
Regex for python shebang is incorrect #945
Comments
Hi, ok, I think I've understood the issue and that you're right, the regex should be something like: Can you test with |
Thanks for looking into this. Your new regex seems to do the job. Sadly I have no way to verify it fast, since I encountered the issue in gitlabs snippets and am not familar with the workflow involved. I can verify it next weekend tho. |
I think we could even simplify things further. Rouge needs to highlight well, but it doesn't have to be always 100% syntactically correct for a language. So, for instance, we could do something like:
|
The Python lexer only supported minor version numbers for shebangs involving `python2`. Minor versions of Python 3 should also be included. This commit corrects that problem and supports minor version numbers higher than 9. This fixes rouge-ruby#945.
Using a shebang with a specific python subversion:
breaks the syntax highlighting for the file.
It has probably to do with this regex (example) as pointed out by Mark Fletcher in the Gitlab Issue.
The text was updated successfully, but these errors were encountered: