Skip to content

Commit

Permalink
fix(parser): strip tab from comment block
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Feb 6, 2016
1 parent 3cf5cfd commit a04f502
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Parser/CommentParser.js
Expand Up @@ -22,10 +22,10 @@ export default class CommentParser {

// TODO: refactor
comment = comment.replace(/\r\n/gm, '\n'); // for windows
comment = comment.replace(/^\t*\s?/gm, ''); // remove trailing tab
comment = comment.replace(/^\t*\s?/gm, ''); // remove line head space
comment = comment.replace(/^\*\s?/, ''); // remove first '*'
comment = comment.replace(/ $/, ''); // remove last ' '
comment = comment.replace(/^ *\* ?/gm, ''); // remove line head '*'
comment = comment.replace(/\s$/, ''); // remove last space
comment = comment.replace(/^\s*\*\s?/gm, ''); // remove line head '*'
if (comment.charAt(0) !== '@') comment = '@desc ' + comment; // auto insert @desc
comment = comment.replace(/\s*$/, ''); // remove tail space.
comment = comment.replace(/^(@\w+)$/gm, '$1 \\TRUE'); // auto insert tag text to non-text tag (e.g. @interface)
Expand Down

0 comments on commit a04f502

Please sign in to comment.