Skip to content

Commit

Permalink
pattern-lab#5 - Temporarily change SCSS to CSS for Prism
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpioli committed Oct 10, 2017
1 parent 120b0df commit 0bb842b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ function pluginInit(patternlab) {
var snippetString = '';
if (pluginConfig.tabsToAdd && pluginConfig.tabsToAdd.length > 0) {
for (let j = 0; j < pluginConfig.tabsToAdd.length; j++) {
let tabSnippetLocal = tab_frontend_snippet.replace(/<<type>>/g, pluginConfig.tabsToAdd[j]).replace(/<<typeUC>>/g, pluginConfig.tabsToAdd[j].toUpperCase());
let typePrism = pluginConfig.tabsToAdd[j];
if (typePrism === 'scss') {
typePrism = 'css';
}
let tabSnippetLocal = tab_frontend_snippet.replace(/<<type>>/g, pluginConfig.tabsToAdd[j]).replace(/<<typeUC>>/g, pluginConfig.tabsToAdd[j].toUpperCase()).replace(/<<typePrism>>/g, typePrism);
snippetString += tabSnippetLocal + EOL;
}
tabJSFileContents = tabJSFileContents.replace('/*SNIPPETS*/', snippetString);
Expand Down
4 changes: 4 additions & 0 deletions src/snippet.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* global PrismLanguages */

PrismLanguages.add({'<<type>>': '<<typePrism>>'});

/* global Panels */

Panels.add({
Expand Down

0 comments on commit 0bb842b

Please sign in to comment.