How to use the common-tags.codeBlock 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 DefinitelyTyped / DefinitelyTyped / common-tags / common-tags-tests.ts View on Github external
I like ${['apples', 'bananas', 'watermelons']}
  They're good!
`;

let fruits = ['apple', 'orange', 'watermelon'];

commonTags.html`
  <div class="list">
    <ul>
      ${fruits.map(fruit =&gt; `<li>${fruit}</li>`)}
      ${'<li>kiwi</li>\n<li>guava</li>'}
    </ul>
  </div>
`;

commonTags.codeBlock`
  <div class="list">
    <ul>
      ${fruits.map(fruit =&gt; `<li>${fruit}</li>`)}
      ${'<li>kiwi</li>\n<li>guava</li>'}
    </ul>
  </div>
`;

commonTags.source`
  <div class="list">
    <ul>
      ${fruits.map(fruit =&gt; `<li>${fruit}</li>`)}
      ${'<li>kiwi</li>\n<li>guava</li>'}
    </ul>
  </div>
`;