How to use the juice/client.inlineContent function in juice

To help you get started, we’ve selected a few juice 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 alexwforsythe / code-blocks / client / sidebar.js View on Github external
block.addClass(language);
    }

    const node = block[0];
    hljs.highlightBlock(node);

    var highlighted = block.prop('outerHTML');
    if (css) {
        const params = {
            applyHeightAttributes: false,
            applyWidthAttributes: false,
            inlinePseudoElements: false,
            preserveFontFaces: false,
            preserveMediaQueries: false
        };
        highlighted = juice.inlineContent(highlighted, css, params);
    }

    block = $($.parseHTML(highlighted));
    if (noBackground) {
        block.css('background', defaultBgc);
    }

    return block;
}