How to use the diffhtml.html.strict function in diffhtml

To help you get started, we’ve selected a few diffhtml 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 tbranyen / diffhtml / packages / diffhtml-render-to-string / index.js View on Github external
exports.renderToString = function renderToString(markup, options = {}) {
  const parseHTML = options.strict ? html.strict : html;
  const childNodes = typeof markup === 'string' ? parseHTML(markup) : markup;
  const newTree = createTree('#document-fragment', {}, childNodes);
  const oldTree = createTree(newTree.rawNodeName);

  return innerHTML(oldTree, newTree, { tasks: [...tasks], options });
};