Skip to content
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

Punctuation highlighting does not match CodeMirror #19

Open
dakoop opened this issue Jun 8, 2022 · 1 comment
Open

Punctuation highlighting does not match CodeMirror #19

dakoop opened this issue Jun 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@dakoop
Copy link

dakoop commented Jun 8, 2022

Description

In JupyterLab, CodeMirror does not tag items like brackets, colons, semi-colons, parentheses, and commas as punctuation. pygments flags such elements as punctuation and jupyterlab_pygments styles them as --jp-mirror-editor-punctuation-color, leading to a mismatch in color for these elements. Don't think this is a big deal, and one could argue that pygments is doing a better job, but it does seem to be inconsistent.

Reproduce

  1. Create a JupyterLab notebook with the cell a = [1,2,3,4]; print(a[1:3]) and save it as demo.ipynb
  2. Run nbconvert --to html --template lab demo.ipynb
  3. Inspect the differences in the output html file and the original notebook rendered in JupyterLab. The colors for brackets, colons, semi-colons, parentheses, and commas are blue in the html file and the default text color in JupyterLab.

Expected behavior

These elements would be the default text color.

Context

  • Operating System and version: macOS 12.4
  • Browser and version: Safari 15.5
  • JupyterLab version: 3.4.2

Suggested fix

Comment out the line setting the punctuation color here:

Punctuation: 'var(--jp-mirror-editor-punctuation-color)' # class: 'p'

@dakoop dakoop added the bug Something isn't working label Jun 8, 2022
@welcome
Copy link

welcome bot commented Jun 8, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant