How to use the html-entities.AllHtmlEntities.encode function in html-entities

To help you get started, we’ve selected a few html-entities 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 mrvautin / expressCart / lib / common.js View on Github external
_.forEach(fields, (value, key) => {
        settingsFile[key] = value;
        if(key === 'customCss_input'){
            settingsFile.customCss = escape.encode(uglifycss.processString(value));
        }
        if(key === 'footerHtml_input'){
            const footerHtml = typeof value !== 'undefined' || value === '' ? escape.encode(value) : '';
            settingsFile.footerHtml = footerHtml;
        }
        if(key === 'googleAnalytics_input'){
            const googleAnalytics = typeof value !== 'undefined' ? escape.encode(value) : '';
            settingsFile.googleAnalytics = googleAnalytics;
        }
    });
github mkloubert / vs-deploy / src / browser / host.ts View on Github external
parts.forEach((x, i) => {
                let isLast = i >= (parts.length - 1);
                currentDir += '/' + x;

                addCrumbItem('/?p=' + encodeURIComponent(currentDir), Entities.encode(x),
                             isLast);
            });
        }
github mkloubert / vs-deploy / src / browser / host.ts View on Github external
deploy_helpers.isBinaryContent(data).then((isBinary) => {
                if (isBinary) {
                    html.write('@TODO: This is binary content!');

                    html.sendTo(resp);
                }
                else {
                    let str = data.toString('utf8');

                    let content = `
<div class="panel panel-default vsd-code-panel">
  <div class="panel-heading">${Entities.encode(Path.basename(file))}</div>

  <div class="panel-body">
    <pre class="vsd-code-block"><code class="${ext}">${Entities.encode(str)}</code></pre>
  </div>
</div>


`;

                    html.write(content);
github mkloubert / vs-deploy / src / browser / host.ts View on Github external
dirList.forEach((x) =&gt; {
                                    let dirName = Path.basename(x);

                                    let ext = Path.extname(x);
                                    if (ext) {
                                        ext = ext.substr(1).toLowerCase().trim();
                                    }

                                    let cssClass = '';
                                    if (ext) {
                                        cssClass = `vsd-dir-${ext}`;
                                    }

                                    let dirPath = encodeURIComponent(dirRelativePath + '/' + dirName);

                                    content += `<li class="list-group-item vsd-dir${cssClass}"><a href="/?p=${dirPath}">${Entities.encode(dirName)}</a></li>`;
                                });
github mkloubert / vs-deploy / src / browser / host.ts View on Github external
fileList.forEach((x) =&gt; {
                                    let fileName = Path.basename(x);

                                    let ext = Path.extname(x);
                                    if (ext) {
                                        ext = ext.substr(1).toLowerCase().trim();
                                    }

                                    let cssClass = '';
                                    if (ext) {
                                        cssClass = `vsd-file-${ext}`;
                                    }

                                    let filePath = encodeURIComponent(dirRelativePath + '/' + fileName);

                                    content += `<li class="list-group-item vsd-file${cssClass}"><a href="/?p=${filePath}">${Entities.encode(fileName)}</a></li>`;
                                });
github mkloubert / vs-deploy / src / browser / host.ts View on Github external
deploy_helpers.isBinaryContent(data).then((isBinary) =&gt; {
                if (isBinary) {
                    html.write('@TODO: This is binary content!');

                    html.sendTo(resp);
                }
                else {
                    let str = data.toString('utf8');

                    let content = `
<div class="panel panel-default vsd-code-panel">
  <div class="panel-heading">${Entities.encode(Path.basename(file))}</div>

  <div class="panel-body">
    <pre class="vsd-code-block"><code class="${ext}">${Entities.encode(str)}</code></pre>
  </div>
</div>


`;
github mrvautin / expressCart / lib / common.js View on Github external
_.forEach(fields, (value, key) => {
        settingsFile[key] = value;
        if(key === 'customCss_input'){
            settingsFile.customCss = escape.encode(uglifycss.processString(value));
        }
        if(key === 'footerHtml_input'){
            const footerHtml = typeof value !== 'undefined' || value === '' ? escape.encode(value) : '';
            settingsFile.footerHtml = footerHtml;
        }
        if(key === 'googleAnalytics_input'){
            const googleAnalytics = typeof value !== 'undefined' ? escape.encode(value) : '';
            settingsFile.googleAnalytics = googleAnalytics;
        }
    });
github mrvautin / expressCart / lib / common.js View on Github external
_.forEach(fields, (value, key) => {
        settingsFile[key] = value;
        if(key === 'customCss_input'){
            settingsFile.customCss = escape.encode(uglifycss.processString(value));
        }
        if(key === 'footerHtml_input'){
            const footerHtml = typeof value !== 'undefined' || value === '' ? escape.encode(value) : '';
            settingsFile.footerHtml = footerHtml;
        }
        if(key === 'googleAnalytics_input'){
            const googleAnalytics = typeof value !== 'undefined' ? escape.encode(value) : '';
            settingsFile.googleAnalytics = googleAnalytics;
        }
    });