How to use the anser.escapeForHtml 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 moxystudio / webpack-isomorphic-dev-middleware / lib / renderErrorMiddleware.js View on Github external
function createHtmlDocument(message) {
    const body = anser.ansiToHtml(anser.escapeForHtml(message), { use_classes: true }); // eslint-disable-line camelcase

    // CSS styles based on https://github.com/glenjamin/webpack-hot-middleware/blob/master/client-overlay.js#L5 with some slight changes
    return `

    
        
        <title>webpack-isomorphic-dev-middleware error</title>
        <style>
        body {
            background: #262626;
            color: #e6e6e6;
            line-height: 1.2;
            font-family: Menlo, Consolas, monospace;
            font-size: 13px;
            white-space: pre;
            margin: 10px;</style>

anser

A low level parser for ANSI sequences.

MIT
Latest version published 2 months ago

Package Health Score

85 / 100
Full package analysis