private string GetFormattedTeaserText(ListAllLogbookEntriesOutputPort.LogbookItem logbookItem) { var teaserText = GetTeaserText(logbookItem); return(string.IsNullOrWhiteSpace(teaserText) ? teaserText : textFormatter.GetHtmlText(teaserText)); }
private string GetTeaserText(ListAllLogbookEntriesOutputPort.LogbookItem logbookItem) { if (!string.IsNullOrWhiteSpace(logbookItem.TeaserText)) { return(logbookItem.TeaserText); } return(!string.IsNullOrWhiteSpace(logbookItem.Text) && logbookItem.Text.Length > TeaserLength ? $"{logbookItem.Text.Substring(0, TeaserLength)}..." : logbookItem.Text); }