-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
(python) exec and print should be highlighted as built-ins #1468
Comments
It's by design. |
Highlight js uses python 2? |
It tries to highlight Python code of both versions, but makes a guess on how to highlight |
Is it possible to make highligthing print()? |
That's unlikely. It's not a keyword in Python anymore, and I don't see the point in highlighting it as one. Also, I'd need some data on how many users actually want it highlighted. It's the first time anyone raises this point. |
I see, Thank you for your work! |
I really would like you to reconsider see a list of built ins: https://docs.python.org/3/library/functions.html thanks |
Is there any chance this could be reconsidered? As an example, github's highlighting does highlight a = 5
print('foobar', a) |
Read everything above and make a case for why it should be reconsidered. It won't be reconsidered just because you asked nicely - we need a good reason. :) "GitHub does it this way" isn't a case. :) |
see t-h-e p-y-t-h-o-n b-u-i-l-d-i-n-s l-i-s-t, don't know how much clearer it should be... dont reconsider if you want to be stubborn and being stuck in whatever reason this is holding you back, asking nicely should always be a +1 above demanding it |
This is a self-evidently incorrect statement. Github doing it this way is a case to change highlight.js's behaviour, it may (on its own, in your opinion) not be a conclusive case, but that doesn't mean it's not a case. Similarly pygments (the preeminent code highlighter in python) highlights But I agree with @typemytype that the conclusive argument is that Remember, we're not suggesting that hightlight.js forces people to highlight Overall, as someone who reviews (and often refuses) feature requests & bugs everyday, the case that this should not be changed is pretty thin. |
Indeed. I will be clearer next time. You understood my meaning though. :)
I tend to assume past behavior has reasons (and they made sense to me last time I looked at this) - and our very own library author made this change himself... so... that makes the burden perhaps a bit higher. :-) That plus a bit of "say no by default" mixed in.
This seems quite compelling. Reviewing. At the time these changes were made (excluding exec and print) we did not track built_ins separately (at least not in this grammar)... they were keywords... so Ivan was taking the correct step of not highlighting them as keywords any longer. But since we do highlight built-ins it does seems these should again be highlighting - now as built-ins. |
Thanks for reconsidering, I agree entirely with "say no by default", but I think making an exception to that rule here is a good decision. |
PR created. |
I'm still subscribed to this ticket for some reason, so I've read the recent back and forth… I should say @joshgoebel is a saint, were it for me I'd closed and sealed it simply because of sheer amount of entitlement and rudeness in this "discussion". Especially considering that all it should've taken would be pointing out that |
If I'm using just
print
then this is highlight.But if I'm using
print()
then this isn't highlight.<code class="python highlight"></code>
The text was updated successfully, but these errors were encountered: