How to use the fusion-core.escape function in fusion-core

To help you get started, we’ve selected a few fusion-core 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 fusionjs / fusionjs / fusion-cli / plugins / ssr-plugin.js View on Github external
return ctx => {
        const {htmlAttrs, bodyAttrs, title, head, body} = ctx.template;
        const safeAttrs = Object.keys(htmlAttrs)
          .map(attrKey => {
            return ` ${escape(attrKey)}="${escape(htmlAttrs[attrKey])}"`;
          })
          .join('');

        const safeBodyAttrs = Object.keys(bodyAttrs)
          .map(attrKey => {
            return ` ${escape(attrKey)}="${escape(bodyAttrs[attrKey])}"`;
          })
          .join('');

        const safeTitle = escape(title);
        // $FlowFixMe
        const safeHead = head.map(consumeSanitizedHTML).join('');
        // $FlowFixMe
        const safeBody = body.map(consumeSanitizedHTML).join('');

        const coreGlobals = [
          ``,
        ]
          .filter(Boolean)
          .join('');
github fusionjs / fusion-cli / plugins / ssr-plugin.js View on Github external
return ctx => {
        const {htmlAttrs, bodyAttrs, title, head, body} = ctx.template;
        const safeAttrs = Object.keys(htmlAttrs)
          .map(attrKey => {
            return ` ${escape(attrKey)}="${escape(htmlAttrs[attrKey])}"`;
          })
          .join('');

        const safeBodyAttrs = Object.keys(bodyAttrs)
          .map(attrKey => {
            return ` ${escape(attrKey)}="${escape(bodyAttrs[attrKey])}"`;
          })
          .join('');

        const safeTitle = escape(title);
        // $FlowFixMe
        const safeHead = head.map(consumeSanitizedHTML).join('');
        // $FlowFixMe
        const safeBody = body.map(consumeSanitizedHTML).join('');

        const coreGlobals = [
          ``,
        ]
          .filter(Boolean)
          .join('');
github fusionjs / fusionjs / fusion-cli / plugins / ssr-plugin.js View on Github external
.map(attrKey => {
            return ` ${escape(attrKey)}="${escape(htmlAttrs[attrKey])}"`;
          })
          .join('');
github fusionjs / fusion-cli / plugins / ssr-plugin.js View on Github external
.map(attrKey => {
            return ` ${escape(attrKey)}="${escape(bodyAttrs[attrKey])}"`;
          })
          .join('');
github fusionjs / fusion-cli / plugins / ssr-plugin.js View on Github external
.map(attrKey => {
            return ` ${escape(attrKey)}="${escape(htmlAttrs[attrKey])}"`;
          })
          .join('');