PrismJS / PrismJS/prism

Diff-Highlight vs. line-numbers

Open
#2,393 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm scratching my head how to achieve the following:
I'm using both, diff-highlight and line-numbers plugin.

Whenever a line has been deleted, I don't want to show the line numbers, when lines have been added, they of course can count on.
Unfortunately the line-number plugin works on the pre element, and up to now the only chance I saw, was to close the pre and reopen it, but this will end-up in a quite strange looking result (see attached).
Is there a chance to show the deleted lines also within the same pre-block and additionally stop counting lines?
Or do I have to change my concept and show all added/deleted lines from now on in separate blocks?

2020-05-18 22_01_49-Window

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

Reproduce the interaction between the diff-highlight and line-numbers plugins using the example in the issue, then inspect how both plugins process the same pre block. Done means deleted lines remain in that block without line numbers while added lines continue counting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.