add Markdown (.md) file reader with formatting support #1698 by dcherrera
This commit is contained in:
+3
-1
@@ -40,9 +40,11 @@ std::string Txt::getTitle() const {
|
||||
size_t lastSlash = filepath.find_last_of('/');
|
||||
std::string filename = (lastSlash != std::string::npos) ? filepath.substr(lastSlash + 1) : filepath;
|
||||
|
||||
// Remove .txt extension
|
||||
// Remove .txt or .mdextension
|
||||
if (FsHelpers::hasTxtExtension(filename)) {
|
||||
filename = filename.substr(0, filename.length() - 4);
|
||||
} else if (FsHelpers::hasMarkdownExtension(filename)) {
|
||||
filename = filename.substr(0, filename.length() - 3);
|
||||
}
|
||||
|
||||
return filename;
|
||||
|
||||
Reference in New Issue
Block a user