question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python3 syntax highlighting currently not working

See original GitHub issue

What is the problem?

Code blocks that are marked with python3 are not highlighted. image

How can I reproduce it?

Here is the markdown of a random Leetcode problem: https://gist.github.com/parkershamblin/bde8ad0db5f1e78a68dc11c98b59d06a After downloading it and opening it up in vscode try running the command: Markdown: Print current document to HTML

The resulting html page should look like the one shown above.

Additional details

If you edit the markdown and change “python3” to “python” in front of the code blocks you will get syntax highlighting and the resulting html page will look like this. image This is my current solution. However, you can see that the syntax highlighting is not 100% accurate with this approach (i.e. type hinting not being supported).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Lemminghcommented, Jul 23, 2020

highlightjs/highlight.js#2633

2reactions
yzhang-ghcommented, Jul 12, 2020

This is handled by VSCode’s built-in Markdown extension (https://github.com/microsoft/vscode/blob/eed137ff2ef7d6b96aa9a7b41307b4c21cda4627/extensions/markdown-language-features/src/markdownEngine.ts#L326-L335) which uses highlight.js that doesn’t seem to support python3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syntax highlighting breaks on Python3 return type hinting #862
Following a return type hint on a function definition, the syntax coloring is broken. def f(x : bool): '''Summary that has good syntax...
Read more >
Syntax highlighting not working for Python in VS Code with ...
Basically syntax highlighting is a VS Code thing, not an extension thing. I would try changing your theme and see if that leads...
Read more >
Can't get syntax highlighting for Python 3 on vim - Reddit
I do have +python3 when vim --version. Can't seem to figure out what is the problem. Syntax highlighting for python (2) works well....
Read more >
How can I fix "missing" syntax highlighting for Python ...
1 Answer 1 · In syntax/<filetype>.vim the syntax rules are defined with the :syntax command. This command defines, well, syntax. · :highlight says ......
Read more >
PyQt/Python syntax highlighting
I modified this code to fix a problem when triple-quotes were embedded inside strings. -- Artemio Garza Reyna 2021-08-08 20:26:00.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found