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

pull/1/head
yflory 4 years ago
parent bdbfbaa109
commit 88ff7a0219

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

Loading…
Cancel
Save