From f5a3f9e15d15524aac657056ee1b01e0c5bc4a25 Mon Sep 17 00:00:00 2001 From: Arthur Tazhitdinov Date: Thu, 22 Jan 2026 21:29:57 +0500 Subject: [PATCH] feat: treat .md files as .txt --- src/activities/home/MyLibraryActivity.cpp | 3 ++- src/activities/reader/ReaderActivity.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/activities/home/MyLibraryActivity.cpp b/src/activities/home/MyLibraryActivity.cpp index 9e6f3734..1db32397 100644 --- a/src/activities/home/MyLibraryActivity.cpp +++ b/src/activities/home/MyLibraryActivity.cpp @@ -120,7 +120,8 @@ void MyLibraryActivity::loadFiles() { } else { auto filename = std::string(name); if (StringUtils::checkFileExtension(filename, ".epub") || StringUtils::checkFileExtension(filename, ".xtch") || - StringUtils::checkFileExtension(filename, ".xtc") || StringUtils::checkFileExtension(filename, ".txt")) { + StringUtils::checkFileExtension(filename, ".xtc") || StringUtils::checkFileExtension(filename, ".txt") || + StringUtils::checkFileExtension(filename, ".md")) { files.emplace_back(filename); } } diff --git a/src/activities/reader/ReaderActivity.cpp b/src/activities/reader/ReaderActivity.cpp index 14d6623c..83c54042 100644 --- a/src/activities/reader/ReaderActivity.cpp +++ b/src/activities/reader/ReaderActivity.cpp @@ -24,7 +24,7 @@ bool ReaderActivity::isXtcFile(const std::string& path) { bool ReaderActivity::isTxtFile(const std::string& path) { if (path.length() < 4) return false; std::string ext4 = path.substr(path.length() - 4); - return ext4 == ".txt" || ext4 == ".TXT"; + return ext4 == ".txt" || ext4 == ".TXT" || ext4 == ".md" || ext4 == ".MD"; // Treat .md as txt files (until we have a markdown reader) } std::unique_ptr ReaderActivity::loadEpub(const std::string& path) {