PrismJS / PrismJS/prism

Line highlight doesn't line up when a line above text wraps

Open
#3,770 0 comments 0 reactions 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: doesn't matter
  • Plugins: line highlight is the issue but see below
/* PrismJS 1.28.0
https://prismjs.com/download.html#themes=prism-tomorrow&languages=clike+javascript+python&plugins=line-highlight+line-numbers+autolinker+show-language+autoloader+toolbar+copy-to-clipboard+download-button+match-braces */

Description

I have the line highlight plugin to emphasize some lines on my website. However, when I view it in mobile the lines text wrap (intentionally) and mess up the alignment on the line highlight boxes.

mobile view:

image

wider view (no text wrapping = correct lines get highlighted):

image

(for reference, the page is: https://dragoncoder047.github.io/pages/ulisp_howto/macros.html)

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 issue on the linked ulisp_howto/macros.html page at a narrow mobile width, using the line-highlight plugin with wrapped code. Start by inspecting the line-highlight plugin and compare its positions before and after a line above wraps. Done means highlighted boxes remain aligned with their intended lines at both narrow and wide widths, with a regression test if the existing test setup supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
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.