Repository navigation
fix: syntax highlighting lost when toggling Editable on MudCodeViewer - #642
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #642 +/- ##
==========================================
+ Coverage 65.38% 65.39% +0.01%
==========================================
Files 111 111
Lines 8381 8384 +3
Branches 1480 1480
==========================================
+ Hits 5480 5483 +3
Misses 2394 2394
Partials 507 507 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…wer` When the `Editable` parameter changes, syntax highlighting is lost until the text is modified. This happens because no parameter scope is registered for `Editable`, so `ParameterChanged` is never invoked on change. As a result, the `MudCode.highlight` JS function isn't called after the DOM updates, leaving the code unhighlighted. I ran into this in my project; it's also reported in CodeBeamOrg#628. The fix registers `Editable` in the parameter scope, the same way as `Code`, `ShowLineNumbers`, etc. This ensures `ParameterChanged` fires when `Editable` changes, triggering `MudCode.highlight` to re-highlight the code after the DOM update.
8258db1 to
daf415e
Compare
|
Thanks 🥇 |
|
Hello Mehmet, have you planed to release a new version on NuGet with the fixes that were merged? |
Probably we will release new version on this week. If something is very important for you please inform me again |
|
Great, thanks! |
|
@mckaragoz Kind reminder about this, which probably slipped through. 😉 |
Hi, v. 9.1.1 already released 16 days ago. Am I missing something? |
|
I had looked at CodeBeam.MudBlazor.Extensions instead of CodeBeam.MudBlazor.Extensions.Code and saw the last version was released 5 months ago. Sorry for the confusion and thanks for the release! |
|
Always welcome. |
When the
Editableparameter changes, syntax highlighting is lostuntil the text is modified.
This happens because no parameter scope is registered for
Editable,so
ParameterChangedis never invoked on change. As a result, theMudCode.highlightJS function isn't called after the DOM updates,leaving the code unhighlighted.
I ran into this in my project; it's also reported in #628.
The fix registers
Editablein the parameter scope, the same way asCode,ShowLineNumbers, etc. This ensuresParameterChangedfireswhen
Editablechanges, triggeringMudCode.highlightto re-highlightthe code after the DOM update.