🚀 Add ".MD" file format
* Added support for markdown file format (.md)
This commit is contained in:
parent
98ad641b9b
commit
abc276a35d
3 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@ fun Constants.provideSupportedExtensions() = listOf(
|
||||||
".txt",
|
".txt",
|
||||||
".zip",
|
".zip",
|
||||||
".html",
|
".html",
|
||||||
".htm"
|
".htm",
|
||||||
|
".md"
|
||||||
)
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue