How to use typograf - 1 common examples

To help you get started, we’ve selected a few typograf 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 xtremespb / zoia2 / src / modules / pages / api / apiPageSave.js View on Github external
Object.keys(req.zoiaConfig.languages).map(language => {
                if (formData[language]) {
                    let contentCompiled = formData[language].content;
                    if (formData[language].extras.indexOf('typo') > -1) {
                        const locale = [];
                        if (language !== 'en') {
                            locale.push(language);
                        }
                        locale.push('en-US');
                        contentCompiled = new Typograf({
                            locale
                        }).execute(formData[language].content);
                    }
                    if (formData[language].extras.indexOf('minify') > -1) {
                        contentCompiled = minify(contentCompiled, {
                            caseSensitive: true,
                            decodeEntities: true,
                            html5: true,
                            collapseWhitespace: true,
                            removeComments: true,
                            removeRedundantAttributes: true
                        });
                    }
                    pageData.data[language] = {
                        title: formData[language].title,
                        content: formData[language].content,

typograf

The client and server typography

MIT
Latest version published 3 days ago

Package Health Score

73 / 100
Full package analysis

Popular typograf functions