CSS selector for `language-xxxx` class does not account for substrings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Information:
- Prism version: all
- Environment: all with a DOM
Description
Prism's CSS selector for code blocks works on detecting a language-xxxx class, but that detection has false positives because it works on substrings.
This likely also affects plugins that add to the selector string.
Example
copy-language-python is detected as a language-xxxx class. See #3363.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open components/prism-core.js at the linked selector code and compare its matching behavior with the copy-language-python example. Adjust the selector so only a complete language-xxxx class is detected, including when plugins extend the selector string, and verify that the false positive described in #3363 no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100