Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

matchdom

node v8.17.0
version: master
endpointsharetweet
const matchdom = require("matchdom") require("jsdom") require("jsdom-global")() require("dom4") const dom = require("dom-template-strings") let str = "wicked" matchdom(dom`<div id="model" class="[myclass]"> <span>[data.text]</span> </div>`, { myclass: "yes", data: { text: "test" } }).outerHTML
matchdom(dom`<table border="true"> <tr> <td>[list.key|repeat:tr]</td> <td>[list.val|magnet:tr]</td> </tr> </table>`, { list: [{key: 'a', val: 'one'}, {key: 'b', val: 'two'}, {key: 'c'}] }).outerHTML
matchdom(dom`<table border="true"> <tr> <td>[rows.cells.val|repeat:tr|repeat] [some.data]</td> </tr> </table>`, { rows: [ {cells: [{val:'A1'}, {val:'A2'}]}, {cells: [{val:'B1'}, {val:'B2'}]} ], some: { data: "x" } }).outerHTML
matchdom(dom`<div> <a href="/test?toto=1" data-href="?id=[id|url]&amp;status=[status|url]">[title]</a> </div>`, { id: 'xx', title: 'anchor', status: "12" }).outerHTML
Loading…

no comments

    sign in to comment