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};