fix colors littlebit

This commit is contained in:
MeexReay 2025-03-21 23:03:04 +03:00
parent d8425ab635
commit 1f9c739878

View File

@ -100,16 +100,16 @@ function stripColors(content) {
} }
function makeColorCodesPrintable(input) { function makeColorCodesPrintable(input) {
return input.replace(/\$#([0-9a-fA-F]{6})/g, '$$##$1') return input.replace(/\$#([0-9a-fA-F]{6})/g, '$##$1')
.replace(/\$([A-Z_]+)--/g, '$$#$1--') .replace(/\$([A-Z_]+)--/g, '$#$1--')
.replace(/\$reset/g, '$$#reset'); .replace(/\$reset/g, '$#reset');
} }
function convertColorCodes(input) { function convertColorCodes(input) {
return input.replace(/\$#([0-9a-fA-F]{6})/g, '<span style="color: #$1">') return input.replace(/\$#([0-9a-fA-F]{6})/g, '<span style="color: #$1">')
.replace(/\$##([0-9a-fA-F]{6})/g, '$#$1') .replace(/\$##([0-9a-fA-F]{6})/g, '$#$1')
.replace(/\$([A-Z_]+)--/g, '<span style="color: --$1">') .replace(/\$([A-Z_]+)--/g, '<span style="color: --$1">')
.replace(/\$#([A-Z_]+)--/g, '$$$1--') .replace(/\$#([A-Z_]+)--/g, '$$1--')
.replace(/\$reset/g, '</span>') .replace(/\$reset/g, '</span>')
.replace(/\$#reset/g, '$reset'); .replace(/\$#reset/g, '$reset');
} }