get tests passing

pull/4863/head
Richard Harris 5 years ago
parent 215c5e62e1
commit 236fd67f74

@ -321,21 +321,25 @@ export class HtmlTag {
constructor(anchor: HTMLElement = null) {
this.a = anchor;
this.e = this.n = null;
}
m(html: string, target: HTMLElement, anchor: HTMLElement = null) {
if (!this.e) {
this.e = element(target.nodeName as keyof HTMLElementTagNameMap);
this.t = target;
this.h(html);
}
this.u(html, anchor);
this.i(anchor);
}
u(html: string, anchor) {
h(html) {
this.e.innerHTML = html;
this.n = Array.from(this.e.childNodes);
}
i(anchor) {
for (let i = 0; i < this.n.length; i += 1) {
insert(this.t, this.n[i], anchor);
}
@ -343,7 +347,8 @@ export class HtmlTag {
p(html: string) {
this.d();
this.u(html, this.a);
this.h(html);
this.i(this.a);
}
d() {

@ -53,7 +53,7 @@ function create_each_block(ctx) {
t5 = text(" ago:");
t6 = space();
attr(span, "class", "meta");
html_tag = new HtmlTag(raw_value, null);
html_tag = new HtmlTag(null);
attr(div, "class", "comment");
},
m(target, anchor) {
@ -67,7 +67,7 @@ function create_each_block(ctx) {
append(span, t4);
append(span, t5);
append(div, t6);
html_tag.m(div);
html_tag.m(raw_value, div);
},
p(ctx, dirty) {
if (dirty & /*comments*/ 1 && t2_value !== (t2_value = /*comment*/ ctx[4].author + "")) set_data(t2, t2_value);

Loading…
Cancel
Save