How to use the @adobe/helix-shared.multiline function in @adobe/helix-shared

To help you get started, we’ve selected a few @adobe/helix-shared 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 adobe / helix-pipeline / test / testHTMLFromMarkdown.js View on Github external
const assertMd = async (md, html, secrets = {}) => {
  const fromHTML = (context) => {
    context.response = {
      status: 201,
      body: context.content.document.body.innerHTML,
    };
  };

  const generated = await pipe(
    fromHTML,
    { content: { body: multiline(md) }, request: crequest },
    {
      logger,
      request: { params },
      secrets,
    },
  );

  // check equality of the dom, but throw assertion based on strings to visualize difference.
  const act = new JSDOM(generated.response.body);
  const exp = new JSDOM(html);
  assertEquivalentNode(act.window.document.body, exp.window.document.body);
};
github adobe / helix-pipeline / test / testFrontmatter.js View on Github external
const procMd = (md) => {
  const dat = { content: { body: multiline(md) } };
  parseMd(dat, { logger });
  const orig = cloneDeep(dat.content.mdast);
  parseFront(dat, { logger });
  return { orig, proc: dat.content.mdast };
};