mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-07 08:07:40 +03:00
feat: treat .md files as .txt
This commit is contained in:
parent
3ce11f14ce
commit
f5a3f9e15d
@ -120,7 +120,8 @@ void MyLibraryActivity::loadFiles() {
|
|||||||
} else {
|
} else {
|
||||||
auto filename = std::string(name);
|
auto filename = std::string(name);
|
||||||
if (StringUtils::checkFileExtension(filename, ".epub") || StringUtils::checkFileExtension(filename, ".xtch") ||
|
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);
|
files.emplace_back(filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ bool ReaderActivity::isXtcFile(const std::string& path) {
|
|||||||
bool ReaderActivity::isTxtFile(const std::string& path) {
|
bool ReaderActivity::isTxtFile(const std::string& path) {
|
||||||
if (path.length() < 4) return false;
|
if (path.length() < 4) return false;
|
||||||
std::string ext4 = path.substr(path.length() - 4);
|
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<Epub> ReaderActivity::loadEpub(const std::string& path) {
|
std::unique_ptr<Epub> ReaderActivity::loadEpub(const std::string& path) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user