From 543115b9938aad990cc601dfdc62a1b07ca5b178 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 5 Mar 2021 16:52:42 +0100 Subject: [PATCH] Force .md extensions to be recognized as markdown when uploading a file --- www/common/sframe-common-file.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/sframe-common-file.js b/www/common/sframe-common-file.js index bb700e7a6..fb432b5ad 100644 --- a/www/common/sframe-common-file.js +++ b/www/common/sframe-common-file.js @@ -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({