diff --git a/src/webpage/markdown.ts b/src/webpage/markdown.ts index 9885032..0c2f4f6 100644 --- a/src/webpage/markdown.ts +++ b/src/webpage/markdown.ts @@ -731,11 +731,22 @@ class MarkDown { } else { restore = saveCaretPosition(box, offset); } - box.innerHTML = ""; + if (this.customBox) { + //TODO maybe the custom logic applies here as well, but that's a later thing + box.innerHTML = ""; box.append(this.customBox[0](this.rawString)); } else { - box.append(this.makeHTML({keep: true})); + //console.time(); + const html = this.makeHTML({keep: true}); + //TODO this may be slow, may want to check in on this in the future if it is + if (!box.hasChildNodes() || html.isEqualNode(Array.from(box.childNodes)[0])) { + console.log("no replace needed"); + } else { + box.innerHTML = ""; + box.append(html); + } + //console.timeEnd(); } if (restore) { restore(); diff --git a/src/webpage/register.ts b/src/webpage/register.ts index eb114ef..a3d3b08 100644 --- a/src/webpage/register.ts +++ b/src/webpage/register.ts @@ -100,7 +100,7 @@ function handleErrors(errors: any, elements: HTMLFormControlsCollection) { } else if (errors.password) { showError( elements[3] as HTMLElement, - I18n.getTranslation("register.passwordError", errors.password._errors[0].message), + I18n.getTranslation("register.passwordError:", errors.password._errors[0].message), ); } else if (errors.username) { showError(