How to use the anser.ansiToHtml function in anser

To help you get started, we’ve selected a few anser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gitlabhq / gitlabhq / app / assets / javascripts / pipelines / components / pipeline_details.vue View on Github external
.then((resp) => {
                  const log = Anser.ansiToHtml(resp.bodyText, {use_classes: true});
                  const linkedLog = Anser.linkify(log);

                  this.store.storeLog(linkedLog.split('\n'));
                })
            })
github eclipse-theia / theia / packages / console / src / browser / ansi-console-item.tsx View on Github external
constructor(
        public readonly content: string,
        public readonly severity?: MessageType
    ) {
        this.htmlContent = ansiToHtml(this.content, {
            use_classes: true,
            remove_empty: true
        });
    }
github hashicorp / levant / vendor / github.com / hashicorp / nomad / ui / app / utils / classes / log.js View on Github external
output: computed('logPointer', 'head', 'tail', function() {
    let logs = this.logPointer === 'head' ? this.head : this.tail;
    let colouredLogs = Anser.ansiToHtml(logs);
    return htmlSafe(colouredLogs);
  }),
github hashicorp / nomad / ui / app / utils / classes / log.js View on Github external
get output() {
    let logs = this.logPointer === 'head' ? this.head : this.tail;
    logs = logs.replace(//g, '>');
    let colouredLogs = Anser.ansiToHtml(logs);
    return htmlSafe(colouredLogs);
  }

anser

A low level parser for ANSI sequences.

MIT
Latest version published 2 months ago

Package Health Score

85 / 100
Full package analysis