How to use the fusion-core.dangerouslySetHTML 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 austin94 / fusion-todo-boilerplate / src / plugins / TodoPlugin.js View on Github external
const applyTodoMvcStyling = (ctx, assetUrl) => {
  const escapeHtml = dangerouslySetHTML(
    ``
  );
  ctx.template.head.push(escapeHtml);
};
github fusionjs / fusionjs / fusion-plugin-react-helmet-async / src / server.js View on Github external
return async (ctx, next) => {
        if (!ctx.element) {
          return next();
        }
        const helmetContext = {};
        ctx.element = (
          {ctx.element}
        );
        await next();
        const {helmet} = helmetContext;
        if (helmet) {
          ctx.template.title = dangerouslySetHTML(
            helmet.title
              .toString()
              .replace('', '')
              .replace(/^/, '')
          );
          keys.forEach(key => {
            ctx.template.head.push(dangerouslySetHTML(helmet[key].toString()));
          });
        }
      };
    },
github fusionjs / fusionjs / fusion-plugin-styletron-react / src / server.js View on Github external
return next().then(() => {
          const stylesForHead = engine.getStylesheetsHtml();
          ctx.template.head.push(dangerouslySetHTML(stylesForHead));
        });
      } else {
github fusionjs / fusionjs / fusion-plugin-font-loader-react / src / plugin.js View on Github external
if (__NODE__) {
            ctx.template.head.push(html`<style>`);
            if (withStyleOverloads) {
              ctx.template.head.push(
                dangerouslySetHTML(generateStyledFontFaces(styledFonts))
              );
            } else {
              ctx.template.head.push(
                dangerouslySetHTML(generateAtomicFontFaces(atomicFonts))
              );
            }
            ctx.template.head.push(html`</style>`);
            if (!withStyleOverloads) {
              const atomicFonts: AtomicFontsObjectType = (fonts: any);
              ctx.template.head.push(
                dangerouslySetHTML(
                  generatePreloadLinks(
                    preloadOverrides || preloadSession.fontsToPreload,
                    atomicFonts
                  )
                )
              );
            }
          }
        });
      } else {
github fusionjs / fusionjs / fusion-plugin-react-helmet-async / src / server.js View on Github external
keys.forEach(key => {
            ctx.template.head.push(dangerouslySetHTML(helmet[key].toString()));
          });
        }
github fusionjs / fusionjs / fusion-plugin-font-loader-react / src / plugin.js View on Github external
return next().then(() =&gt; {
          if (__NODE__) {
            ctx.template.head.push(html`<style>`);
            if (withStyleOverloads) {
              ctx.template.head.push(
                dangerouslySetHTML(generateStyledFontFaces(styledFonts))
              );
            } else {
              ctx.template.head.push(
                dangerouslySetHTML(generateAtomicFontFaces(atomicFonts))
              );
            }
            ctx.template.head.push(html`</style>`);
            if (!withStyleOverloads) {
              const atomicFonts: AtomicFontsObjectType = (fonts: any);
              ctx.template.head.push(
                dangerouslySetHTML(
                  generatePreloadLinks(
                    preloadOverrides || preloadSession.fontsToPreload,
                    atomicFonts
                  )
                )
              );
            }
          }
        });
github fusionjs / fusionjs / fusion-plugin-font-loader-react / src / plugin.js View on Github external
return next().then(() =&gt; {
          if (__NODE__) {
            ctx.template.head.push(html`<style>`);
            if (withStyleOverloads) {
              ctx.template.head.push(
                dangerouslySetHTML(generateStyledFontFaces(styledFonts))
              );
            } else {
              ctx.template.head.push(
                dangerouslySetHTML(generateAtomicFontFaces(atomicFonts))
              );
            }
            ctx.template.head.push(html`</style>`);
            if (!withStyleOverloads) {
              const atomicFonts: AtomicFontsObjectType = (fonts: any);
              ctx.template.head.push(
                dangerouslySetHTML(
                  generatePreloadLinks(
                    preloadOverrides || preloadSession.fontsToPreload,
                    atomicFonts
                  )
                )