Skip to content

1.0.5 - #6

Open
RATR2 wants to merge 3 commits into
mainfrom
1.0.5
Open

1.0.5#6
RATR2 wants to merge 3 commits into
mainfrom
1.0.5

Conversation

@RATR2

@RATR2 RATR2 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Two color-tag fixes:

  1. <##rrggbb> support - some addons write hex color tags with a doubled # prefix. Extended all three places that recognize <#rrggbb> (the live decoration engine, the color picker, and the static grammar fallback) to also accept the doubled form. The color picker preserves whichever of #/## the original tag used when a new color is picked.

  2. Fixed "colors are weird" report - scanColorRuns colored the tag's own literal characters (&c, <#5f0202>, etc.) the same as the text that followed, not just the text the tag actually styles. Barely noticeable for a subtle legacy code, but very visible for hex tags with an extreme color: <#5f0202> (near-black dark red) made the 9-character tag markup itself nearly illegible against a dark theme, and <#fffb00> (near-white bright yellow) made it look like a glaring highlighted block - reproduced directly from the reported file (anon.sk). Real chat rendering never shows the tag as literal text either way (it's a control sequence), so only coloring what comes after it is both more correct and fixes the look. Fixed by starting each colored run after the matched tag instead of at it.

Version bump: 1.0.4 -> 1.0.5.

Test plan

  • npm run typecheck
  • npm run build
  • Verified both <#rrggbb> and <##rrggbb> detected correctly by the decoration engine and color picker
  • Verified picking a new color preserves the original #/## prefix
  • Reproduced the exact reported strings (<#5f0202>Ritual Table, <#fffb00>Ritual Craft) and confirmed the tag markup is no longer colored, only the following text
  • Verified multi-tag (gradient-style) and legacy &c&l...&r&7... cases still work correctly after the fix
  • Packaged and installed locally via .vsix

RATR2 added 3 commits July 11, 2026 08:35
Some addons write hex color tags with a doubled "#" prefix. Extended
all three places that recognize <#rrggbb> to also accept <##rrggbb>:
the live decoration engine (scanColorRuns), the color picker
(DocumentColorProvider), and the static grammar fallback. The color
picker also now preserves whichever of "#"/"##" the original tag used
when a new color is picked, instead of always collapsing back to a
single "#".

Version bump: 1.0.4 -> 1.0.5.
scanColorRuns started each colored run at the tag's own position
(match.index), so the literal tag characters (&c, <#5f0202>, etc.) got
colored the same as the text that followed them - not just the text
the tag is meant to style. This is invisible for a subtle legacy code,
but very noticeable for hex tags with an extreme color: <#5f0202>
(near-black dark red) made the 9-character tag markup itself nearly
illegible against a dark theme, and <#fffb00> (near-white bright
yellow) made it look like a glaring highlighted block - both reported
as "colors are weird" from a real file. Real chat rendering never
shows the tag as literal text either way (it's a control sequence
consumed by the client), so only coloring what comes after it is both
more correct and avoids this. Fixed by starting the run after the
matched tag instead of at it.
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.

1 participant