Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrovich committed Jan 10, 2018
1 parent f98ad37 commit c09b300
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ function parseDescriptionMarkdown(markdown, component) {
};

const createBlockFromExternalSource = (name, language, content, optionsString) => {
return '```' + name + '.' + language + optionsString + '\n' +
content +
'```';
return '```' + name + '.' + language + optionsString + '\n' +
content +
'```';
};

// Extracts examples from description blocks
Expand Down Expand Up @@ -193,8 +193,8 @@ function parseDescriptionMarkdown(markdown, component) {
if (externalSource) {
var componentDir = path.dirname(component.getFilepath());
if (externalSourceWildcard) {
var externalSourceFiles = dir.files(path.resolve(componentDir, externalSource), {sync: true});
var extractedExampleBlocks = [];
var externalSourceFiles = dir.files(path.resolve(componentDir, externalSource), {sync: true});
var extractedExampleBlocks = [];
_.forEach(externalSourceFiles, filepath => {
var language = path.extname(filepath).substr(1);
var content = fs.readFileSync(filepath, 'utf8');
Expand All @@ -220,9 +220,9 @@ function parseDescriptionMarkdown(markdown, component) {
}


// replace the external source definition block in the description with the content from the external source
var regexp = new RegExp('```\\s*' + name + '\\:' + externalSource + '\\.' + language + '(.*\n)+?```', 'gm');
description = description.replace(regexp, () => createBlockFromExternalSource(name, language, content, optionsString));
// replace the external source definition block in the description with the content from the external source
var regexp = new RegExp('```\\s*' + name + '\\:' + externalSource + '\\.' + language + '(.*\n)+?```', 'gm');
description = description.replace(regexp, () => createBlockFromExternalSource(name, language, content, optionsString));
}
} else {
content = block
Expand Down

0 comments on commit c09b300

Please sign in to comment.