-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Hi there,
I noticed that when editing .md
(Markdown) files in TinyFileManager, the Ace Editor (Advanced editor view) does not activate Markdown syntax highlighting by default. Instead, it falls back to plain text, while other file types like .js
or .php
are highlighted correctly.
Upon checking the code, I found that the editor mode is set using this line:
editor.getSession().setMode({
path: "ace/mode/<?php echo $ext; ?>",
inline: true
});
However, $ext
resolves to 'md'
for Markdown files, and Ace does not have a mode called md
— it expects 'markdown'
. As a result, syntax highlighting doesn't work out of the box for .md
files.
Suggested Fix:
A simple conditional mapping like this solves the problem:
if ($ext === 'md') {
$ext = 'markdown';
}
You could either:
- Add this line near where
$ext
is defined, - Or apply it just before the editor is initialized.
Why this matters:
Markdown is a very common format for README files, notes, and static content, so it would be great if it worked with proper highlighting by default.
Thanks for your great work on this project! TinyFileManager is incredibly useful and lightweight — really appreciated. 😊