mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-12-12 14:24:02 +01:00
chat: fix messages like ^35121.0^7 showing as .0
This happens because Quake colors are meant to be only a single character, yet the regular expression uses the `+` operator.
This commit is contained in:
@@ -29,7 +29,7 @@ Vue.component('message', {
|
||||
return `<span style="color: rgb(${this.color[0]}, ${this.color[1]}, ${this.color[2]})">${str}</span>`
|
||||
},
|
||||
colorize(str) {
|
||||
let s = "<span>" + (str.replace(/\^([0-9]+)/g, (str, color) => `</span><span class="color-${color}">`)) + "</span>";
|
||||
let s = "<span>" + (str.replace(/\^([0-9])/g, (str, color) => `</span><span class="color-${color}">`)) + "</span>";
|
||||
|
||||
const styleDict = {
|
||||
'*': 'font-weight: bold;',
|
||||
|
||||
Reference in New Issue
Block a user