Commit 8258db1
fix: syntax highlighting lost when toggling
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 #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.Editable on MudCodeViewer
1 parent 6051e0e commit 8258db1
1 file changed
Lines changed: 4 additions & 0 deletions
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
0 commit comments