Skip to content

Conversation

@D4isDAVID
Copy link
Contributor

@D4isDAVID D4isDAVID commented Nov 7, 2025

Goal of this PR

Fix a bug where given a chat template such as <span class="content">{0}</span>, sending colored messages such as ~b~test or ^1test would remove the surrounding <span class="content"> element.

How is this PR achieving the goal

Colorize the template parameters directly before passing them to the template.

Currently, the entire template is passed to the colorize method, which:

  • Takes the element, such as <span class="content">^1test</span> (^1test is the {0} parameter in this case)
  • Wraps it in a span element: <span><span class="content">^1test</span></span>
  • Replaces the colors with </span><span class="some-color-class">: <span><span class="content"></span><span class="color-1">test</span></span>
  • Removes empty span elements: <span><span class="color-1">test</span></span>

If we colorize the parameters beforehand, the surrounding template element would not be affected by the parameters, as they would already be colorized.

This PR applies to the following area(s)

FiveM, RedM

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action labels Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant