Skip to content

Commit ec8f60b

Browse files
ErisDSDSchau
authored andcommitted
feat(gatsby-remark-embed-snippet): Add rb support (#12416)
This tiny change allows the gatsby-remark-embed-snippet plugin to correctly highlight ruby files. The plugin allows embedding files like: `embed:myfile.myext` For many languages, the language name and the extension are the same e.g. .html or .js or .css. However, for some languages, the extension does not match E.g. for ruby, the extension is `.rb` and the language is `ruby`. In the case where these do not map, the plugin relies on an internal map. This adds the mapping from .rb to ruby, so that ruby files are highlighted correctly. ## Summary - Affects only gatsby-remark-embed-snippet plugin - Added a mapping from rb -> ruby files - This means files called something.rb will be correctly highlighted as ruby
1 parent 417cc44 commit ec8f60b

File tree

1 file changed

+1
-0
lines changed
  • packages/gatsby-remark-embed-snippet/src

1 file changed

+1
-0
lines changed

packages/gatsby-remark-embed-snippet/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const FILE_EXTENSION_TO_LANGUAGE_MAP = {
1212
js: `jsx`,
1313
md: `markup`,
1414
sh: `bash`,
15+
rb: `ruby`,
1516
}
1617

1718
const getLanguage = file => {

0 commit comments

Comments
 (0)