From 7fcd32ea7a970b3c52a3afaaa3021c58ef4e8286 Mon Sep 17 00:00:00 2001 From: Bart Jaskulski Date: Wed, 12 Apr 2023 10:18:51 +0200 Subject: [PATCH] fix(highlight): #747 Add line offset to highlight line 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]: https://github.com/PrismJS/prism/commit/9a4e725b76d22759fec58e1929450bbfe1bb6661 Signed-off-by: Bart Jaskulski --- CHANGELOG.md | 4 ++++ src/Whoops/Resources/views/frame_code.html.php | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57388b8..97cbe13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Unreleased + +* Fixed missing code highlight, which additionally led to issue with switching tabs, between application and all frames ([#747](https://github.com/filp/whoops/issues/747)). + ## v2.15.1 * Fixed bug with PrettyPageHandler "*Calling `getFrameFilters` method on null*" ([#751](https://github.com/filp/whoops/pull/751)). diff --git a/src/Whoops/Resources/views/frame_code.html.php b/src/Whoops/Resources/views/frame_code.html.php index 9675eee..fd3d930 100644 --- a/src/Whoops/Resources/views/frame_code.html.php +++ b/src/Whoops/Resources/views/frame_code.html.php @@ -31,6 +31,7 @@ ?>
escape($code) ?>