diff --git a/backend/FwLite/LcmCrdt/Objects/Entry.cs b/backend/FwLite/LcmCrdt/Objects/Entry.cs index 453d648dd..df29f6d4a 100644 --- a/backend/FwLite/LcmCrdt/Objects/Entry.cs +++ b/backend/FwLite/LcmCrdt/Objects/Entry.cs @@ -34,11 +34,11 @@ public string Headword(WritingSystemId ws) { var word = CitationForm[ws]; if (string.IsNullOrEmpty(word)) word = LexemeForm[ws]; - return word; + return word.Trim(); } protected static Expression> HeadwordExpression() => - (e, ws) => Json.Value(e.CitationForm, ms => ms[ws]) ?? Json.Value(e.LexemeForm, ms => ms[ws]); + (e, ws) => (string.IsNullOrEmpty(Json.Value(e.CitationForm, ms => ms[ws])) ? Json.Value(e.LexemeForm, ms => ms[ws]) : Json.Value(e.CitationForm, ms => ms[ws]))!.Trim(); public Guid[] GetReferences() {