PrismJS / PrismJS/prism

Show Invisibles: Problems with modifying grammars

Open
#1,609 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Because Show Invisibles modifies the language definition itself, there might be problems with:

  1. The rest property is "unfolded" after we add the patterns for ICs which results in the tokens of rest being highlighted after the IC tokens.
  2. Other plugins (e.g. Autolinker) also modify language definitions at run-time (meaning via hooks). Show Invisibles has to be run after these plugins to be compatible. (#1612)

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 by inspecting the Show Invisibles and Autolinker plugin hooks and how language definitions are modified at runtime. Reproduce the rest token-ordering issue and the plugin-ordering interaction described here; done means both highlighting behaviors are compatible without requiring an undocumented execution order.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.