How to use the ent/encode function in ent

To help you get started, we’ve selected a few ent 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 redbadger / website-honestly / site / compiler / index.js View on Github external
export function compileRoutes(state) {
  const stateNavigator = createStateNavigator();

  const encodedState = (state && encode(JSON.stringify(state)));

  const compile = route => {
    const path = (process.env.URL_BASENAME || '') + route.filePath;

    const title = `${route.title} | ${TITLE_SUFFIX}`;

    stateNavigator.navigateLink(route.link, 'none');
    const renderStart = Date.now();
    const bodyContent = renderToString(route.component({ stateNavigator, title }, route.props));
    const renderMs = Date.now() - renderStart;

    const ejsStart = Date.now();
    const body = layoutTemplate({
      title,
      tracking,
      bodyContent,

ent

Encode and decode HTML entities

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis