PrismJS / PrismJS/prism

Highlight & annotation alignement drift issue on Chrome

Open
#1,298 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,
I'm using the highlight plugin and a derivated plugin (annotator : https://github.com/memtt/malt/blob/11f2e71dedc024eb66d8d26da26e9e48097d6352/src/webview/client-files/app/js/prism.js#L889) to annotate the source code.

It works well on firefox but on chrome the annotation and highlight are missaligned as you can see on the picture. For showing the issue I printed the line number in the annotation instead of the real content and we clearly see they are miss-aligned. Any idea ? I tried to play with the isLineHeightRounded funciton without any success. There is a small drift because the annotation at the top of the file are well placed, I start to see a one line shift after ~250 lines.

capture du 2018-02-16 13-28-00

Cheers.

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 the linked src/webview/client-files/app/js/prism.js around line 889 and inspect the isLineHeightRounded function while reproducing the annotation drift in Chrome and Firefox. Done means annotations and highlights remain aligned throughout a long source file, including after roughly 250 lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.