markdown update fixes

This commit is contained in:
MathMan05 2025-01-12 14:14:36 -06:00
parent 4581aea6b9
commit d828abe2ff
2 changed files with 14 additions and 3 deletions

View file

@ -731,11 +731,22 @@ class MarkDown {
} else { } else {
restore = saveCaretPosition(box, offset); restore = saveCaretPosition(box, offset);
} }
box.innerHTML = "";
if (this.customBox) { 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)); box.append(this.customBox[0](this.rawString));
} else { } 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) { if (restore) {
restore(); restore();

View file

@ -100,7 +100,7 @@ function handleErrors(errors: any, elements: HTMLFormControlsCollection) {
} else if (errors.password) { } else if (errors.password) {
showError( showError(
elements[3] as HTMLElement, 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) { } else if (errors.username) {
showError( showError(