PrismJS / PrismJS/prism

Highlighted line of code is off screen

Open
#1,879 1 comment 1 reaction 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

Somehow, I was expecting that that the line of code highlighted would scroll into view. For example, the window can only display 20 lines, but the highlighted line is 75. One can't tell that any code is highlighted until they scroll down.

Is there a way to auto scroll, say to line 15 making line 15 be the top line in the viewable window? That way, line 20 with the highlight is immediately visible.

I thought I saw this in a sample somewhere but I can't seem to track it down.

Thanks!

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

No file, test, or entry point is named in the issue, so begin by tracing how highlighted lines are rendered and positioned in the browser. Done means a highlighted line outside the visible area automatically scrolls into view, with the requested line placement, and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

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