Skip to content

Commit

Permalink
correct headword code to trim and switch to lexeme form when citation…
Browse files Browse the repository at this point in the history
… form is empty
  • Loading branch information
hahn-kev committed Jul 12, 2024
1 parent 8d47271 commit 8d47c9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/FwLite/LcmCrdt/Objects/Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Func<Entry, WritingSystemId, string?>> 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()
{
Expand Down

0 comments on commit 8d47c9b

Please sign in to comment.