Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CMEONE committed Apr 23, 2021
1 parent 928ff9a commit 3de518e
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions tApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class tApp {
static currentHash = "/";
static debugComponentTiming;
static get version() {
return "v0.10.9";
return "v0.10.10";
}
static configure(params) {
if(params == null) {
Expand Down Expand Up @@ -589,8 +589,10 @@ class tApp {
}
}
prevNotNull.after(afterChildren[i]);
beforeChildren[i] = afterChildren[i];
} else {
nextNotNull.before(afterChildren[i]);
beforeChildren[i] = afterChildren[i];
}
}
} else if(afterChildren[i] == null) {
Expand Down Expand Up @@ -659,7 +661,25 @@ class tApp {
}
let domRendered = htmlToDOM(rendered);
domRendered.setAttribute("tapp-component", component.id);
rendered = tApp.unescape(domRendered.outerHTML);
rendered = domRendered.outerHTML;
let it = rendered.matchAll(new RegExp("{{{[\\s|\\t]*(.+?(?=}}}))[\\s|\\t]*}}}", "g"));
let next = it.next();
while(!next.done) {
rendered = rendered.replace(next.value[0], tApp.unescape(next.value[0]));
next = it.next();
}
it = rendered.matchAll(new RegExp("{%[\\s|\\t]*(.+?(?=%}))[\\s|\\t]*%}", "g"));
next = it.next();
while(!next.done) {
rendered = rendered.replace(next.value[0], tApp.unescape(next.value[0]));
next = it.next();
}
it = rendered.matchAll(new RegExp("\\[\\[[\\s|\\t]*(.+?(?=\\]\\]))[\\s|\\t]*\\]\\]", "g"));
next = it.next();
while(!next.done) {
rendered = rendered.replace(next.value[0], tApp.unescape(next.value[0]));
next = it.next();
}
return tApp.compileTemplate(rendered, {
props: props,
state: component.state,
Expand Down Expand Up @@ -1181,6 +1201,9 @@ tApp.Component = class {
toString() {
return tApp.compileComponent(this);
}
elements() {
return document.querySelectorAll(`[tapp-component="${this.#id}"]`);
}
}

tApp.GlobalComponent = (function() {
Expand Down

0 comments on commit 3de518e

Please sign in to comment.