From 4d766400396fca51426039f2c9bb72856d9badb7 Mon Sep 17 00:00:00 2001 From: Masafumi Koba Date: Fri, 13 Jul 2018 22:00:35 +0900 Subject: [PATCH] Add file extensions support for major languages This adds aliases for file extensions of some major languages. - `.coffee` -> `.coffee` - `.md` -> `.markdown` - `.py` -> `.python` - `.rb` -> `.ruby` - `.yml` -> `.yaml` --- components/prism-coffeescript.js | 1 + components/prism-markdown.js | 2 ++ components/prism-python.js | 2 ++ components/prism-ruby.js | 2 ++ components/prism-yaml.js | 2 ++ 5 files changed, 9 insertions(+) diff --git a/components/prism-coffeescript.js b/components/prism-coffeescript.js index 8d7ef937d7..db6ad7ba03 100644 --- a/components/prism-coffeescript.js +++ b/components/prism-coffeescript.js @@ -88,4 +88,5 @@ Prism.languages.insertBefore('coffeescript', 'keyword', { delete Prism.languages.coffeescript['template-string']; +Prism.languages.coffee = Prism.languages.coffeescript; }(Prism)); \ No newline at end of file diff --git a/components/prism-markdown.js b/components/prism-markdown.js index 22c6a4b681..eba1af6556 100644 --- a/components/prism-markdown.js +++ b/components/prism-markdown.js @@ -225,3 +225,5 @@ Prism.hooks.add('wrap', function (env) { env.content = Prism.highlight(code, grammar, codeLang); }); + +Prism.languages.md = Prism.languages.markdown; \ No newline at end of file diff --git a/components/prism-python.js b/components/prism-python.js index ea1a51545a..143c15b41e 100644 --- a/components/prism-python.js +++ b/components/prism-python.js @@ -60,3 +60,5 @@ Prism.languages.python = { }; Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python; + +Prism.languages.py = Prism.languages.python; \ No newline at end of file diff --git a/components/prism-ruby.js b/components/prism-ruby.js index 72b5ebbade..13e43f1d61 100644 --- a/components/prism-ruby.js +++ b/components/prism-ruby.js @@ -138,4 +138,6 @@ } } ]; + + Prism.languages.rb = Prism.languages.ruby; }(Prism)); diff --git a/components/prism-yaml.js b/components/prism-yaml.js index 4846e41e60..abe2db9fc9 100644 --- a/components/prism-yaml.js +++ b/components/prism-yaml.js @@ -43,3 +43,5 @@ Prism.languages.yaml = { 'important': /[&*][\w]+/, 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./ }; + +Prism.languages.yml = Prism.languages.yaml; \ No newline at end of file