README.MD is not recognized as markdown while README.md is. I suppose there is a case sensitive pattern for checking the file extension. Is it a bug or a feature?
I am willing to submit a PR but I am not Rust developers so pointers to the right lines would be appreciated ;)
I can confirm this bug.
I believe the issue is caused by how Sublime syntaxes specify their applicable file extensions. The highlighting library used by bat (Syntect) determines the syntax for a file extension using a case-sensitive comparison. I'm not sure if the Sublime syntax file_extensions field is intended to be case-insensitive or not, but depending on the answer to that, either Syntect or sublimehq/Packages is doing something incorrectly.
Unfortunately, it looks like the Markdown syntax file that we use only specifies lowercase file extensions. I'm not sure how @sharkdp would prefer to handle it, but there's a couple options that I can think of:
Include --map-syntax MD:md in your bat config file.
This can be done without any changes to bat or the Sublime Packages repository.
Create a patch file for the Markdown syntax and patch it during the build process.
While it could work, I don't think it's an ideal solution.
Create an upstream issue about it.
@HakubJozak Thank you for your feedback.
I'm not sure if the Sublime syntax
file_extensionsfield is intended to be case-insensitive or not, but depending on the answer to that, either Syntect or sublimehq/Packages is doing something incorrectly.
Third possible option: the uppercase .MD file extension should not really be supported because it's non standard(?).
I think it's correct that the file_extensions field is case-sensitive. The field is also use to match against full filenames, and some of these are case-sensitive (PKGBUILD, CMakeLists.txt, Dockerfile). Apparently, there are also some file extensions which are case-sensitive (.M for Objective C, see https://en.wikipedia.org/wiki/Objective-C).
So if this should be fixed, it has to be added to the Markdown syntax file.
I'm going to close this for now. @HakubJozak If you feel that .MD should be supported, please open a bug report at https://github.com/sublimehq/Packages
Most helpful comment
@HakubJozak Thank you for your feedback.
Third possible option: the uppercase
.MDfile extension should not really be supported because it's non standard(?).I think it's correct that the
file_extensionsfield is case-sensitive. The field is also use to match against full filenames, and some of these are case-sensitive (PKGBUILD,CMakeLists.txt,Dockerfile). Apparently, there are also some file extensions which are case-sensitive (.Mfor Objective C, see https://en.wikipedia.org/wiki/Objective-C).So if this should be fixed, it has to be added to the Markdown syntax file.