reStructuredText roles with two parts are not highlighted
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: latest
- Plugins: n/a
- Environment: browser
Description
While translating in Weblate, which uses PrimJS for reStructeredText syntax highlighting, I noticed that roles with two-parts are note being highlighted. E.g. :py:mod:, :http:get:. Common roles works perfectly e.g. :ref:.
This issue was originally reported in https://github.com/WeblateOrg/weblate/issues/8480 but I was directed to this project.
The rule for highlighting is in components/prism-rest.js, line 158, but I haven't figured out a solution to propose :)
Example
See ":http:get:" in the screenshot below:

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
Inspect the role-highlighting rule in components/prism-rest.js around line 158. Reproduce the behavior with :py:mod: and :http:get:, comparing it with the working :ref: example. Done means two-part reStructuredText roles are highlighted correctly without regressing common roles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100