Message from JavaScript discussions

November 2017

— Heres an injector that comes with it, you can add custom ones

— 

// Wraps the entire element in an `<a>` tag and sets it's `href` attribute.
"data-link-wrap": function (input, target) {
var a = document.createElement("a");
a.setAttribute("href", input);
a.insertAdjacentElement("afterbegin", target.cloneNode(true));
target.parentNode.replaceChild(a, target);

— That definitely looks like it does some structure related things like you said

— Works on:

<div data-link-wrap="tag">Hi</div>

— To turn it into

<a href="url"><div>Hi</div></a>

— Updating dynamic data is possible because it can patch templates as well using the removeAttrs: false config setting

Message permanent page

— My equivalent (because I hate mustache and all other template engines that use that syntax)

template:
<a data-href="link" data-content-text="name"></a>

JSON:

{
link: "someLink",
name: "someName"
}

Message permanent page

— There are also no visual side effects to load failure, so you can put in placeholders

— 

<a data-href="link" data-content-text="name">Link Not Loaded</a>

— That's where it goes, yes

— So if your data is null or something, and it doesn't load the data, the template will get loaded just like that

Message permanent page

— Placeholders