See last commit.

This commit is contained in:
schnulller
2022-06-25 23:01:52 +02:00
parent 65e18f136d
commit 056ab77888
14 changed files with 186 additions and 56 deletions

View File

@@ -2,5 +2,5 @@ namespace HaWeb.SearchHelpers;
public interface ISearchable {
public string Index { get; }
public string SearchText { get; }
public string? SearchText { get; }
}

View File

@@ -16,7 +16,7 @@ public class SearchRules {
sb.Append(t);
var sw = reader.State.SearchWord;
if (sb.Length >= sw.Length) {
if (sb.ToString().ToLower().Contains(sw)) {
if (sb.ToString().ToUpperInvariant().Contains(sw)) {
if (reader.State.Results == null)
reader.State.Results = new List<(string Page, string Line)>();
reader.State.Results.Add((reader.CurrentPage, reader.CurrentLine));

View File

@@ -29,7 +29,7 @@ public static class StringHelpers {
}
} else {
skipped = false;
if (toLower) output.Append(char.ToLower(c));
if (toLower) output.Append(char.ToUpperInvariant(c));
else output.Append(c);
}
}