Syntax highlighting for python/python2/python3

Announcements, comments, ideas, feedback, and "How do I... ?" questions
Post Reply
philiplu
Posts: 92
Joined: Wed Aug 02, 2017 8:51 pm
Location: Redmond, WA, USA

Syntax highlighting for python/python2/python3

Post by philiplu »

I've been in the habit of specifying my code items as [code=python3] instead of [code=python]. That made a lot more sense back in 2016 when I started posting, though nowadays python code is usually means Python 3.

I noticed that the syntax highlighter updates made over the summer no longer treat "python3" or "python2" as proper language names. It only seems to like "python". But I've got about 160 forum posts where I use "python3" as the language. Is there any way on your side to allow "python3" or "python2" as aliases for "python"? If not, I guess I'll edit old posts as I happen to be looking at them.
Image
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: Syntax highlighting for python/python2/python3

Post by euler »

Interestingly, there are only 15 matches for "code=python2", but there are 384 matches for "code=python3".

I guess I could do a global replace in the DB, but in case a distinction needs to be made in the future and because some will continue to use "python3" after I've made the changes, I've modified the scripts to use "python2" and "python3" as aliases for "python".
Image
impudens simia et macrologus profundus fabulae
philiplu
Posts: 92
Joined: Wed Aug 02, 2017 8:51 pm
Location: Redmond, WA, USA

Re: Syntax highlighting for python/python2/python3

Post by philiplu »

Looks great! Thanks, @euler. I'll try to remember to just use code=python from now on.
Image
Post Reply