Files Gallery 0.13.0 includes Markdown preview and split view modes.
See Markdown demo:
https://demo.files.gallery/?files#markdown.md

You can modify the markdown configuration from Javascript config markdown option:
_c.config.markdown = {
enabled: true, // markdown editor with split screen and preview enabled
extensions: ['md', 'markdown', 'mdown', 'mkdn', 'mkd', 'mdwn', 'mkdown', 'ron'], // extensions to apply markdown editor on
// modes array and order / default first mode is 'split' on large screens and 'edit' on small screens
modes: matchMedia('(min-width: 576px)').matches ? ['split', 'edit', 'preview'] : ['edit', 'preview', 'split'],
remember_mode: true, // remember current markdown mode when navigating and re-opening / if false, will always reset
scroll_sync: true, // sync scroll in split mode
html: (html) => html, // custom preview html parser in if someone wants to (html) => DOMPurify.sanitize(html)
link_target: '_blank', // open markdown preview links in _blank window on click
// markdown insert shortcuts
shortcuts: {
'B': ['**', '**'], // Ctrl-B bold
'I': ['_', '_'], // Ctrl-I italic
'K': ['[', '](https://)'], // Ctrl-K link
'Alt-I': ['![', ']()'] // Ctrl-Alt-I image
}
}
You can also use ctrl/cmd-P to toggle edit, live and preview modes.