From 44a6c8be64b40936ab7e3ad72b129c158ac133ed Mon Sep 17 00:00:00 2001 From: King Date: Tue, 9 Jan 2018 05:32:46 -0500 Subject: [PATCH] use regex to find ```js & ``` js edge cases --- scripts/tdd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tdd.js b/scripts/tdd.js index 6365a5c6a..8c91a08de 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -44,7 +44,7 @@ snippetFiles // Grab snippetData const fileData = fs.readFileSync(`${activeOrArchive}/${fileName}.md`, 'utf8'); // Grab snippet Code blocks - const fileCode = fileData.slice(fileData.indexOf('```js'), fileData.lastIndexOf('```') + 3); + const fileCode = fileData.slice(fileData.search(/```\s*js/i), fileData.lastIndexOf('```') + 3); // Split code based on code markers const blockMarkers = fileCode .split('\n')