Skip to content

Commit

Permalink
fix: Preserve JSDoc block start/end indentation (#41) (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeAstapov authored and gajus committed Sep 22, 2017
1 parent 86fd67c commit 1a7e8c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/iterateJsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ export default (iterator) => {
return;
}

const jsdoc = commentParser('/*' + jsdocNode.value + '*/', {
// @see https://github.com/yavorskiy/comment-parser/issues/21
// Preserve JSDoc block start/end indentation.
const indent = _.repeat(' ', jsdocNode.loc.start.column);
const jsdoc = commentParser(indent + '/*' + jsdocNode.value + indent + '*/', {
// @see https://github.com/yavorskiy/comment-parser/issues/21
parsers: [
commentParser.PARSERS.parse_tag,
commentParser.PARSERS.parse_type,
Expand Down

0 comments on commit 1a7e8c8

Please sign in to comment.