How to use the common-tags.oneLineTrim function in common-tags

To help you get started, we’ve selected a few common-tags 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 netlify / netlify-cms / cypress / support / commands.js View on Github external
return cy.getMarkdownEditor().should(([element]) => {
    // Slate makes the following representations:
    // - blank line: 2 BOM's + <br>
    // - blank element (placed inside empty elements): 1 BOM + <br>
    // We replace to represent a blank line as a single <br>, and remove the
    // contents of elements that are actually empty.
    const actualDomString = toPlainTree(element.innerHTML)
      .replace(/\uFEFF\uFEFF<br>/g, '<br>')
      .replace(/\uFEFF<br>/g, '');
    expect(actualDomString).toEqual(oneLineTrim(expectedDomString));
  });
});
github doczjs / docz / core / docz-core / src / utils / parse-html.ts View on Github external
${body.raw ? generateRawTags(body.raw) : ''}
    ${body.scripts ? generateScriptTags(body.scripts) : ''}
    ${generateJSReferences(js, publicPath)}`

  const doc = ctags.html(
    template({
      title,
      description,
      lang,
      head: headStr,
      footer: footerStr,
      publicUrl: getPublicUrl(config, dev),
    })
  )

  return trimWhitespace ? ctags.oneLineTrim(doc) : emptyLineTrim(doc)
}
github gregberge / loadable-components / examples / razzle / src / server.js View on Github external
.get('/*', (req, res) =&gt; {
    const extractor = new ChunkExtractor({
      statsFile: path.resolve('build/loadable-stats.json'),
      entrypoints: ['client'],
    })

    const html = renderToString(
      
        
          
        
      ,
    )

    res.status(200).send(
      oneLineTrim(htmlTemplate`
      
      
        
          
          
          <title>Welcome to Razzle</title>
          
          ${extractor.getLinkTags()}
          ${extractor.getStyleTags()}
        
        
          <div id="root">${html}</div>
          ${extractor.getScriptTags()}
        
      
    `),