PrismJS / PrismJS/prism

(Python) Incorrect Highlighting of string

Open
#3,779 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

language-definitions
Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Information

  • Language: Python
  • Plugins: None

The test page to generate the error:
Test Page

Description
In python, we can use a \ (backslash) to continue the string on another line

s = "first line \
second line"

But the syntax doesn't highlight the string.

This doesn't just end in string, but it is used for every line break where line continuation is required.

Reference: python-long-string

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Prism test page and reproduce the Python example containing a backslash-continued string. Trace the Python syntax-highlighting behavior involved, then verify that the complete continued string is highlighted correctly without breaking the following content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.