How to use the diffhtml.html 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-website / api-browser.js View on Github external
strip(tagName, contents) {
    let tree = html(contents);

    const filter = childNodes => {
      return childNodes.map(childNode => {
        if (childNode.nodeName === tagName) {
          return createElement('#text', null, ' ');
        }

        childNode.childNodes = filter(childNode.childNodes);

        return childNode;
      });
    };

    if (tree.childNodes) {
      tree.childNodes = filter(tree.childNodes);
    }
github tbranyen / diffhtml / packages / diffhtml-website / api-browser.js View on Github external
${params.map(tag => html`
                      ${this.getName(tag.name)}
                      ${tag.description ? html(tag.description) : 'n/a'}
                      <code>${this.getDefault(tag.name)}</code>
                      ${String(!tag.optional)}
                    `)}
github tbranyen / diffhtml / packages / diffhtml-website / api-browser.js View on Github external
${examples.length ? examples.map(tag =&gt; html`
                <pre><code class="javascript hljs">
                  ${html(highlightAuto(this.trimCode(tag.string), ['javascript']).value)}
                </code></pre>
              `) : `No examples`}
github tbranyen / diffhtml / packages / diffhtml-website / api-browser.js View on Github external
${this.getName(tag.name)}
                      ${tag.description ? html(tag.description) : 'n/a'}
                      <code>${this.getDefault(tag.name)}</code>
                      ${String(!tag.optional)}
                    `)}
                  
                
              ` : html`
                No arguments to display
              `}

              <h5>Return value</h5>

              ${returnValue.length ? html`<p>
                ${returnValue[0].string}
              </p>` : html('<code>undefined</code>')}

              <div class="gap"></div>
              <hr>
            
          `;
        })}