Синтаксис форматирования текста в терминале Jquery, что я делаю неправильно?

Я использую терминал jquery, и он отлично работает. Однако, на всю жизнь, я не могу понять правильный синтаксис, который будет форматировать мою строку.

Пример говорит

echo([string|function], [options]) — display string on terminal — (additionally if you can call this function with a function as argument it will call that function and print the result, this function will be called every time you resize the terminal or browser). There are three options raw — it will allow to display raw html, finalize — which is callback function with one argument the div container and flush — default is true, if it's false it will not print echo text to terminal until you call flush method. 

You can also use basic text formating using syntax as folow: 

[[guib;<COLOR>;<BACKGROUND>]some text] will display some text:

[[ — open formating
u — underline
s — strike
o — overline
i — italic
b — bold
g — glow (using css text-shadow)
; — separator
color — color of text (hex, short hex or html name of the color)
; — separator
color — background color (hex, short hex or html name of the color)
; — separator [optional]
class — class adeed to format span element [optional]
] — end of format specification
text — text that will be formated (most of the time for internal use, when you format text that's wrap in more then one line you'll get full text in data-text attribute)
] — end of formating

Хорошо... Итак, я пробовал такие вещи, как это

terminal.echo(["s"], myText);

и это

terminal.echo("[[s]" + myText + "]");

и это

terminal.echo([["s"], myText]);

и несколько других.

Это может быть глупый / простой вопрос, но я действительно озадачен. Может кто-нибудь сказать мне, что я делаю не так?

1 ответ

Решение

Получил ответ от Фредерика Хамиди, мне нужно было включить ЦВЕТ и ФОН, они не были обязательными.

Другие вопросы по тегам