Force .md extensions to be recognized as markdown when uploading a file

pull/1/head
yflory 2021-03-05 16:52:42 +01:00
parent bdbfbaa109
commit 88ff7a0219
1 changed files with 6 additions and 1 deletions

View File

@ -428,6 +428,11 @@ define([
if (handleFileState.inProgress) { return void handleFileState.queue.push([file, e, defaultOptions]); }
handleFileState.inProgress = true;
var type = file.type;
if (!file.type && /\.md$/.test(file.name)) {
type = "text/markdown";
}
var thumb;
var file_arraybuffer;
var name = file.name;
@ -438,7 +443,7 @@ define([
if (!abort) {
var metadata = {
name: name,
type: file.type,
type: type,
};
if (thumb) { metadata.thumbnail = thumb; }
queue.push({