Skip to content

Commit

Permalink
Make the matched text bold in source text
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Nov 2, 2024
1 parent ad33516 commit 14b9ec5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion JL.Core/Mining/MiningUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ private static Dictionary<JLField, string> GetMiningParameters(LookupResult look
Dictionary<JLField, string> miningParams = new()
{
[JLField.LocalTime] = DateTime.Now.ToString("s", CultureInfo.InvariantCulture),
[JLField.SourceText] = useHtmlTags ? currentText.ReplaceLineEndings("<br/>") : currentText,
[JLField.SourceText] = useHtmlTags
? string.Create(CultureInfo.InvariantCulture, $"{currentText[..currentCharPosition]}<b>{lookupResult.MatchedText}</b>{currentText[(currentCharPosition + lookupResult.MatchedText.Length)..]}").ReplaceLineEndings("<br/>")
: currentText,
[JLField.DictionaryName] = lookupResult.Dict.Name,
[JLField.MatchedText] = lookupResult.MatchedText,
[JLField.DeconjugatedMatchedText] = lookupResult.DeconjugatedMatchedText,
Expand Down

0 comments on commit 14b9ec5

Please sign in to comment.