Re-add support for raw text searching.

This commit is contained in:
tastytea 2021-08-17 13:55:53 +02:00
parent 84ef5d1bf3
commit b53e99306c
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 1 deletions

View File

@ -78,7 +78,14 @@ std::vector<match> search(const fs::path &filepath,
for (const auto &file : book.files)
{
const auto &doc{file.second};
const auto &text{doc.text_cleaned};
const auto &text{[&doc, &opts]
{
if (!opts.raw)
{
return doc.text_cleaned;
}
return doc.text_raw;
}()};
string::const_iterator begin{text.begin()};
string::const_iterator end{text.end()};
auto begin_text{begin};