PrismJS / PrismJS/prism

\% in Latex marked as comment, but it's a percentage literal.

Open
#3,563 0 comments 1 reaction 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: LaTeX
  • Plugins: none

Description

The value is 25~\% above its limit.

should no be a comment. it's literally a percentage sign.

As workaround I added this to the LaTeX language definition.

        'char': {
            pattern: /\\%/,
            greedy: true
        },

Dunno what the correct type really should be.

Btw: \% should again be a comment. (preceded by a literal backslash) but nothing happening too likely in real world code.

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 PrismJS's LaTeX language definition and reproduce the supplied example, including the escaped percentage cases. Determine how the definition distinguishes a literal % from a comment, then consider the issue complete when percentage literals are highlighted as content while actual comments remain comments.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.