Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(highlight): #747 Add line offset to highlight line #756

Merged
merged 1 commit into from Apr 12, 2023

Conversation

bart-jaskulski
Copy link
Contributor

PrismJS sort of broken backward compatibility, while trying to improve highlight resilience1. Since then it is required to add data-line-offset for any code, which doesn't start counting from 1, which is pretty each time, we deal with stack frames.

This commits add silently required data attribute in HTML, bringing back highlight feature and recovering from some fall through errors, raised by TypeError in JS execution flow (i.e. switching application and full frames tabs).

Footnotes

  1. https://github.com/PrismJS/prism/commit/9a4e725b76d22759fec58e1929450bbfe1bb6661

PrismJS sort of broken backward compatibility, while trying to improve
highlight resilience[^1]. Since then it is required to add
`data-line-offset` for any code, which doesn't start counting from 1,
which is pretty each time, we deal with stack frames.

This commits add silently required data attribute in HTML, bringing back
highlight feature and recovering from some fall through errors, raised
by `TypeError` in JS execution flow (i.e. switching application and full
frames tabs).

[^1]: PrismJS/prism@9a4e725

Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com>
@bart-jaskulski
Copy link
Contributor Author

bart-jaskulski commented Apr 12, 2023

Actually, offset attribute has started to be required since this commit: PrismJS/prism@098e300

@denis-sokolov denis-sokolov merged commit 3037140 into filp:master Apr 12, 2023
10 checks passed
@denis-sokolov
Copy link
Collaborator

Thank you!

@denis-sokolov
Copy link
Collaborator

Released in 2.15.2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants