Fix detection of markdown files for files having content does not start with '#'

This commit is contained in:
Sebastian Sdorra
2020-08-27 08:11:23 +02:00
parent 5c804f23d7
commit 716c7c5083
7 changed files with 123 additions and 6 deletions

View File

@@ -87,7 +87,7 @@ class SourcesView extends React.Component<Props, State> {
const basePath = this.createBasePath();
if (contentType.startsWith("image/")) {
return <ImageViewer file={file} />;
} else if (contentType.includes("markdown")) {
} else if (contentType.includes("markdown") || (language && language.toLowerCase() === "markdown")) {
return <SwitchableMarkdownViewer file={file} basePath={basePath} />;
} else if (language) {
return <SourcecodeViewer file={file} language={language} />;