wooorm / refractor

Lightweight, robust, elegant virtual syntax highlighting using Prism
MIT License
722 stars 33 forks source link

Update crystal.js with alias 'cr' #68

Closed renamartins closed 6 months ago

renamartins commented 6 months ago

Currently using Prism for code highlighting and the filename extension is used instead of the language name. Files for the Crystal programming language named with the extension .cr (e.g. example.cr) are not recognized in my project because cr is not in the aliases and I would have to manually hardcode crystal (after detecting the .cr extension).

This PR adds the alias cr so it will map back to crystal language.

For reference, compare with Highlight.js (they have the alias): https://github.com/highlightjs/highlight.js/blob/0d7061cd0b098c3a9ecda98163111f4a23aaa2f6/src/languages/crystal.js#L306

wooorm commented 6 months ago

Hey! files here are generated from prism — your change will be overwritten. Better to solve this in the correct place: prism!