Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
python3: a # in an f-string breaks syntax highlighting #225
Comments
MagicPython is still used by Linguist, but the actual syntax hightlighting seems to be driven by something else now. Thus, remove the outdated statement from the README. Closes: #225
ah, bummer. I couldn't find anywhere to post an issue for github itself, so I thought I tracked down that this library is what they use, but apparently not! Back to searching for what they use then... |
MagicPython is still used by Linguist, but the actual syntax hightlighting seems to be driven by something else now. Thus, remove the outdated statement from the README. Closes: #225
Huh, do you have any idea what library they do use, then? Per this github documentation link, they use linguist, but linguist indicates that they use MagicPython in their grammar index. |
Could they just be using an old version, or are you sure they don't use MagicPython anymore? |
Linguist is definitely using a fairly recent version of MagicPython. You might try asking on the community forum at https://github.community/ |
See the code below. Since my issue exists on github, I can simply demonstrate my exact issue with the example code block below. Basically, when a # is used within an f-string, then it appears to break the syntax highlighting. It looks like the "#" in the f-string gets interpreted as the start of a comment, even though this is correctly handled for non-f-srings. The # in the format string is used to get the alternate form for the hex conversion. Here is an example of what the "#" does in a format string as well as demonstrate the bug:
Here is a screenshot to demonstrate the issue (for future reference) since, after this bug is fixed, the code above will presumably have the correct highlighting:
Edit: corrected the 4th output from
0x05
to0005