From e0d1450ce07527148a9a666590ec64be63bb538a Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 28 Jan 2021 17:24:07 +0100 Subject: [PATCH] Rename fieldContainsInlineContent to containsInlineContent to reflect new usage --- qt/aqt/data/web/js/editor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qt/aqt/data/web/js/editor.ts b/qt/aqt/data/web/js/editor.ts index 2c156f5ad..125b9ed5f 100644 --- a/qt/aqt/data/web/js/editor.ts +++ b/qt/aqt/data/web/js/editor.ts @@ -334,7 +334,7 @@ function onBlur(): void { } } -function fieldContainsInlineContent(field: Element): boolean { +function containsInlineContent(field: Element): boolean { if (field.childNodes.length === 0) { // for now, for all practical purposes, empty fields are in block mode return false; @@ -444,13 +444,13 @@ class EditingArea extends HTMLElement { set fieldHTML(content: string) { this.innerHTML = content; - if (fieldContainsInlineContent(this)) { + if (containsInlineContent(this)) { this.appendChild(document.createElement("br")); } } get fieldHTML(): string { - return fieldContainsInlineContent(this) && this.innerHTML.endsWith("
") + return containsInlineContent(this) && this.innerHTML.endsWith("
") ? this.innerHTML.slice(0, -4) // trim trailing
: this.innerHTML; }