From b53e99306cec73b72b09b398de304b12362f7771 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 17 Aug 2021 13:55:53 +0200 Subject: [PATCH] Re-add support for raw text searching. --- src/search.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index a2bb039..e89b2e7 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -78,7 +78,14 @@ std::vector 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};