JSPM

  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q84875F
  • License MIT

Visual helper to place templating code around table tags into correct places

Package Exports

  • html-table-patcher

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-table-patcher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

html-table-patcher

Visual helper to place templating code around table tags into correct places

Install

npm i html-table-patcher

Quick Take

import { strict as assert } from "assert";
import { patcher } from "dist/html-table-patcher.esm";

assert.equal(
  patcher(
    `<table>
{% if customer.details.hasAccount %}
<tr>
  <td>
    variation #1
  </td>
</tr>
{% else %}
<tr>
  <td>
    variation #2
  </td>
</tr>
{% endif %}
</table>`
  ).result,
  `<table>

<tr>
  <td>
    {% if customer.details.hasAccount %}
  </td>
</tr>

<tr>
  <td>
    variation #1
  </td>
</tr>

<tr>
  <td>
    {% else %}
  </td>
</tr>

<tr>
  <td>
    variation #2
  </td>
</tr>

<tr>
  <td>
    {% endif %}
  </td>
</tr>

</table>`
);

Documentation

Please visit codsen.com for a full description of the API and examples.

Licence

MIT License

Copyright (c) 2010-2020 Roy Revelt and other contributors

ok codsen star