Skip to content

Commit

Permalink
fix(backend): 一个词条显示多个《戚林》
Browse files Browse the repository at this point in the history
之前每个词条只显示第一个《戚林》

#1245
  • Loading branch information
ztl8702 committed Jun 19, 2021
1 parent 9a13e39 commit dc69923
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/backend/Services/Frontend/Words.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ IEnumerable<Extension> extensions

var fengRenderer = new FengRichTextRenderer(zhConverter);
output.AddRange(fengDocs.Select(f => fengRenderer.ToRichTextNode(f)));
var hDoc = maybeYngdiengDocument?.Sources
.FirstOrDefault(s => s.SourceCase == YngdiengDocument.Types.Source.SourceOneofCase.CiklinDfd)?.CiklinDfd ?? null;
var hDocs = maybeYngdiengDocument?.Sources
.Where(s => s.SourceCase == YngdiengDocument.Types.Source.SourceOneofCase.CiklinDfd)
.Select(s => s.CiklinDfd)
.ToList()
?? new List<HistoricalDocument>();

var histRenderer = new HistoricalRichTextRenderer(zhConverter);
if (hDoc != null)
{
output.Add(histRenderer.ToRichTextNode(hDoc));
}
output.AddRange(hDocs.Select(hDoc => histRenderer.ToRichTextNode(hDoc)));

var extRenderer = new ExtensionRichTextRenderer(zhConverter);
output.AddRange(extensions.Select(e => extRenderer.ToRichTextNode(hanzi, e.Explanation, e.Source, e.Contributors)));
Expand Down

0 comments on commit dc69923

Please sign in to comment.