Skip to content

Commit

Permalink
Improve DictionaryFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n3436 committed Oct 7, 2023
1 parent 3ea5d6d commit 5b6aaad
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Apis/Dictionary/DictionaryFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,16 @@ public static string FormatExtraInformation(IDictionaryEntry entry)

if (!string.IsNullOrEmpty(entry.Origin))
{
builder.Append($"**Origin of {entry.Entry}**\n{FormatHtml(entry.Origin)}\n\n");
builder.Append($"**Origin of {entry.Entry}**");
}

if (entry.Homograph is not null)
{
builder.Append(SuperscriptDigits[entry.Homograph.Value]);
}

builder.Append($"\n{FormatHtml(entry.Origin)}\n\n");

foreach (var note in entry.SupplementaryNotes)
{
builder.Append($"**{note.Type}**\n");
Expand Down Expand Up @@ -182,10 +189,6 @@ private static string FormatHtml(string htmlText, bool newLineExample = false)
{
builder.Append($"**{content}**");
}
else if (className == "luna-def-number")
{
builder.Append($"\n**{content}**");
}
else
{
builder.Append(content);
Expand Down

0 comments on commit 5b6aaad

Please sign in to comment.