mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 10:32:59 +03:00
fix fucking colors
This commit is contained in:
parent
cb5f2d9dd7
commit
6e10736d97
@ -164,10 +164,10 @@ async function main(args) {
|
||||
} else if (args[1] == "colors") {
|
||||
writeStdout(`# Цвета в консоли
|
||||
|
||||
Вот как сделать цвет: $$#000000
|
||||
Вот как убрать цвет: $$reset
|
||||
Вот как сделать цвет: $##000000
|
||||
Вот как убрать цвет: $#reset
|
||||
|
||||
Чтоб вывести это в консоль как я щас сделал пиши в начале два доллара
|
||||
Чтоб вывести это в консоль как я щас сделал пиши в начале $# вместо просто доллара
|
||||
|
||||
Все понятно?
|
||||
|
||||
|
@ -88,11 +88,15 @@ function updateCursor() {
|
||||
cursor.scrollIntoView({behavior: "smooth", inline: "end"})
|
||||
}
|
||||
|
||||
function stripColors(content) {
|
||||
return convertColorCodes(content)
|
||||
}
|
||||
|
||||
function convertColorCodes(input) {
|
||||
return input.replace(/\$\$#([0-9a-fA-F]{6})/g, '$#$1')
|
||||
.replace(/\$#([0-9a-fA-F]{6})/g, '<span color="#$1">')
|
||||
.replace(/\$\$reset/g, '$reset')
|
||||
.replace(/\$reset/g, '</span>');
|
||||
return input.replace(/\$#([0-9a-fA-F]{6})/g, '<span style="color: #$1">')
|
||||
.replace(/\$##([0-9a-fA-F]{6})/g, '$#$1')
|
||||
.replace(/\$reset/g, '</span>')
|
||||
.replace(/\$#reset/g, '$reset');
|
||||
}
|
||||
|
||||
function stripHtml(html) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user