Skip to content

Commit 1a7e8c8

Browse files
SergeAstapovgajus
authored andcommitted
fix: Preserve JSDoc block start/end indentation (#41) (#42)
1 parent 86fd67c commit 1a7e8c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/iterateJsdoc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ export default (iterator) => {
4545
return;
4646
}
4747

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

0 commit comments

Comments
 (0)