live-guide
Advanced tools
Comparing version 0.13.1 to 0.13.2
@@ -41,6 +41,2 @@ 'use strict'; | ||
task: function(obj) { | ||
function escapeRegExp(string){ | ||
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | ||
} | ||
obj.filteredComments = obj.filteredComments.replace(this.pattern, function(match, language, snippet) { | ||
@@ -50,19 +46,2 @@ if (!snippet) { return match; } | ||
let _tempArray = [], | ||
snippetArray = snippet.split(/\n/); | ||
_tempArray = snippetArray.map((line) => { | ||
let match = obj.rawComments.match(new RegExp('^\\s*' + escapeRegExp(line) + '\\s*$', 'm')); | ||
if (match) { | ||
return match[0]; | ||
} | ||
return undefined; | ||
}).filter((el) => el !== undefined); | ||
if (_tempArray.length === snippetArray.length) { | ||
snippet = _tempArray.join('\n'); | ||
} | ||
return `\`\`\`${language.trim()}\n${snippet}\n\`\`\`\n`; | ||
@@ -69,0 +48,0 @@ }); |
{ | ||
"name": "live-guide", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"description": "Generate style guides based on commented style sheets.", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46087
1213