Markdown preview when sharing folder

Nextcloud version: 13.0.1
Operating system and version: Arch Linux
Apache or nginx version: Nginx 1.12.2
PHP version: 7.2.4

The issue you are facing: When sharing a single markdown file using a link, the file is displayed on the browser as a nice preview:
However, if I share the folder the markdown is in, the only option is to download the file, there’s no preview:

Is there a configuration to enable the preview? I have the markdown editor app, version 2.0.4, but I think the markdown viewer was already there before installing it.


The reason for that behavior is the text editor. The Markdown app only extends the functionality of the text editor, but the reason why you cannot edit/ view the file (like you can with a photo), is because the text editor doesn’t allow public editing. Just tested that on my system.

It’s worth a feature request on Github I think:


Hm, but then in the case of a single file it does not open with texteditor then?
I think the weird part for me is the working for a single file, not for a folder part. It would make sense that whatever is being used for opening a single file (which I would guess is the gallery app?) should also be used for multiple files, but I don’t know which component decides that :thinking:

What you see there for a single file is just the preview. You cannot really view/ edit neither a text file nor an md file.
While I have Onlyoffice running on my server, I can hit “Open with Onlyoffice” for the text file, but I cannot open the file with the text editor. So this is telling me, that there is a limitation in the text editor app.

I just noticed, that there will be small improvement in NC 13.0.2. Text files won’t be displayed as bitmap preview, but as selectable text instead:

(Fix for NC14, but will be backported)

It confirms, that you only see a bitmap as preview for the file. While selectable text is a nice feature/ improvement, it is still no public editing though.

I went a bit down the rabbit hole yesterday night and I think I understood why it doesn’t show; you were right, it was in the texteditor :slight_smile:
I think I have an idea of how to add it to preview (but not to edit), so I’ll try to contribute to it when I have some time. Thanks for the answer!

1 Like

Also, if the shared markdown file contains images on the same server, the images do not render :frowning:

There is no preview anymore, when file is shared (in public). Instead I see blank content. My log says:

Could not find resource core/vendor/marked/marked.min.js to load

The demonstration given in the official Nextcloud-Blog-Article seems to have the same issue.

Tested with NC 15 and 16 on a shared-hosting-provider with several up-to-date browsers.

1 Like