Skip to content

Commit b7327b9

Browse files
committed
Revert "Revert "pattern-lab#5 - Temporarily change SCSS to CSS for Prism""
This reverts commit ea68877.
1 parent ea68877 commit b7327b9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ function pluginInit(patternlab) {
103103
var snippetString = '';
104104
if (pluginConfig.tabsToAdd && pluginConfig.tabsToAdd.length > 0) {
105105
for (let j = 0; j < pluginConfig.tabsToAdd.length; j++) {
106-
let tabSnippetLocal = tab_frontend_snippet.replace(/<<type>>/g, pluginConfig.tabsToAdd[j]).replace(/<<typeUC>>/g, pluginConfig.tabsToAdd[j].toUpperCase());
106+
let typePrism = pluginConfig.tabsToAdd[j];
107+
if (typePrism === 'scss') {
108+
typePrism = 'css';
109+
}
110+
let tabSnippetLocal = tab_frontend_snippet.replace(/<<type>>/g, pluginConfig.tabsToAdd[j]).replace(/<<typeUC>>/g, pluginConfig.tabsToAdd[j].toUpperCase()).replace(/<<typePrism>>/g, typePrism);
107111
snippetString += tabSnippetLocal + EOL;
108112
}
109113
tabJSFileContents = tabJSFileContents.replace('/*SNIPPETS*/', snippetString);

src/snippet.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* global PrismLanguages */
2+
3+
PrismLanguages.add({'<<type>>': '<<typePrism>>'});
4+
15
/* global Panels */
26

37
Panels.add({

0 commit comments

Comments
 (0)