【问题标题】:jQuery cubic terminal, to print result lines on console with html formatsjQuery 三次终端,以 html 格式在控制台上打印结果行
【发布时间】:2016-03-26 19:32:58
【问题描述】:

我想在 echo 函数中以某种方式在终端中显示 html 内容

只是简单的你好,在下面的例子中加粗

    $("#tm").terminal(function (command, term) {
              term.echo('<b>Hello</b> '+command);
           }

我真的不知道它是如何可行的,但是应该有一些选项可以在字符串中为其分配 html 内容。

【问题讨论】:

  • 能否请您改写这个问题,因为不清楚您要做什么?你指的是控制台吗?
  • 是的,我只想将结果显示为 HTML doc,如 table ,控制台上的 URL 链接。假设我可以对选项 html 内容使用相同的 echo 函数,因此字符串中的任何 html 标记都将被解释并在控制台上显示 html。

标签: jquery jquery-terminal


【解决方案1】:

如果指定选项 raw,则可以回显 html:

term.echo('<b>Hello</b> ' + command, {raw: true});

或者如果您只想将文本加粗,请使用终端格式:

term.echo('[[b;;]Hello] ' + command);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-13
    • 2016-11-03
    • 1970-01-01
    • 1970-01-01
    • 2021-08-24
    相关资源
    最近更新 更多