gpt4 book ai didi

Jquery 终端文本格式化语法,我做错了什么?

转载 作者:太空宇宙 更新时间:2023-11-04 03:02:39 27 4
gpt4 key购买 nike

我正在使用 jquery terminal它工作得很好。然而,对于我的一生,我无法找出格式化我的字符串的正确语法。

例子说

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]);

和其他几个。

这可能是一个愚蠢/简单的问题,但我真的很困惑。谁能告诉我我做错了什么?

最佳答案

从 Frédéric Hamidi 那里得到答案,我需要包括 COLOR 和 BACKGROUND,它们不是可选的。

关于Jquery 终端文本格式化语法,我做错了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31055287/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com