Open dimio opened 1 year ago
Hi !
I think CodeMirror.modeInfo
already contains all the information you need to map a file extension to a language:
https://cdn.jsdelivr.net/npm/codemirror@5.65.5/mode/meta.js
And as you can see, there is a CodeMirror.findModeByExtension
function exported too.
Add a bash function for example:
Make a test file:
echo 'echo "Hello World" | tee ./helloworld.sh' | tee ./helloworld.sh
Now use it like this:nopaste helloworld.sh
- it's be highlighted asShell
or
nopaste helloworld.sh https://bokub.github.io/nopaste
(no highlight right now)UPD: highlighted preview: https://deploy-preview-19--nopaste.netlify.app/?l=sh#XQAAgAD//////////wAymMlPivxG3YI4xcyNk1QKsBwb65mrsh4ppM+EJv4miAI/qa2MT8Mwb//8CoAA