diff --git a/src/output.cpp b/src/output.cpp index 2ea5ba3..de9c1fc 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -117,17 +117,17 @@ void json_all(const std::vector> &matches_all) { nlohmann::json json; - json["generator"] = {{"epubgrep", version}}; + json["generator"] = {{"epubgrep", std::string(version)}}; for (const auto &matches : matches_all) { for (const auto &match : matches) { json["matches"].push_back( - {{"filepath_epub", match.filepath_epub}, + {{"filepath_epub", match.filepath_epub.string()}, {"filepath_inside", match.filepath_inside}, {"match", match.text}, - {"context", match.context}, + {"context", {match.context.first, match.context.second}}, {"headline", match.headline}, {"page", match.page}}); }