🚀 Add ".MD" file format

* Added support for markdown file format (.md)
This commit is contained in:
Acclorite 2024-10-22 19:12:56 +03:00
parent 98ad641b9b
commit abc276a35d
3 changed files with 10 additions and 1 deletions

View file

@ -55,6 +55,10 @@ class FileParserImpl @Inject constructor(
htmlFileParser.parse(file) htmlFileParser.parse(file)
} }
".md" -> {
txtFileParser.parse(file)
}
else -> { else -> {
Log.e(FILE_PARSER, "Wrong file format, could not find supported extension.") Log.e(FILE_PARSER, "Wrong file format, could not find supported extension.")
null null

View file

@ -60,6 +60,10 @@ class TextParserImpl @Inject constructor(
htmlTextParser.parse(file) htmlTextParser.parse(file)
} }
".md" -> {
htmlTextParser.parse(file)
}
else -> { else -> {
Log.e(TEXT_PARSER, "Wrong file format, could not find supported extension.") Log.e(TEXT_PARSER, "Wrong file format, could not find supported extension.")
Resource.Error(UIText.StringResource(R.string.error_wrong_file_format)) Resource.Error(UIText.StringResource(R.string.error_wrong_file_format))

View file

@ -7,5 +7,6 @@ fun Constants.provideSupportedExtensions() = listOf(
".txt", ".txt",
".zip", ".zip",
".html", ".html",
".htm" ".htm",
".md"
) )