I've figured it out! I had to add the following lines to ~/.local/share/mime/packages/Override.xml
:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mime-info> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="text/markdown"> <magic priority="50"><match value="##" type="string" offset="0"/></magic> </mime-type> </mime-info>
And then run update-mime-database /home/[username]/.local/share/mime
.
I'm still not quite sure why ##
causes files to be detected as MATLAB by default.