comment-parser
comment-parser copied to clipboard
[Feature Request]: Add option to set MARKER_START and MARKER_START_SKIP.
Hello everyone. First of all, thank you for developing this awesome project. But now, I have a request to parse the comments, as shown below:
/*
* @lc app=leetcode.cn id=1 lang=javascript
*
* https://leetcode-cn.com/problems/two-sum/description/
*
*/
As you can see, this comment starts with /*
, but comment-parser can only parse comments starting with /**
. So I want to known whether it is possible to add a configuration item and let the user decide MARKER_START
and MARKER_START_SKIP
. https://github.com/syavorsky/comment-parser/blob/master/parser.js#L6-L7
If possible, this will help me a lot.
While this would not technically be jsdoc, there are some environments where jsdoc-style tags are allowed, e.g., multiline comments without double asterisks: https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check , so I can see how this might be of potentially wider interest . (Although we currently use regular expressions for such parsing, our no-bad-blocks rule in eslint-plugin-jsdoc
tries to prevent blocks without double asterisks unless certain tags as these TypeScript tags are present.)
This is reasonable suggestion, I will try to make it configurable in upcoming 1.0
Yes, I also considered that my requirements might affect the previous functionality of the commenter-parser, but if implemented, this would make the commenter-parser more flexible and usable.
---Original--- From: "Brett Zamir"<[email protected]> Date: 2020/11/25 21:54:01 To: "syavorsky/comment-parser"<[email protected]>; Cc: "EvanOne(文一)"<[email protected]>;"Author"<[email protected]>; Subject: Re: [syavorsky/comment-parser] [Feature Request]: Add option to set MARKER_START and MARKER_START_SKIP. (#97)
While this would not technically be jsdoc, there are some environments where jsdoc-style tags are allowed, e.g., multiline comments without double asterisks: https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check , so I can see how this might be of potentially wider interest . (Although we currently use regular expressions for such parsing, our no-bad-blocks rule in eslint-plugin-jsdoc tries to prevent blocks without double asterisks unless certain tags as these TypeScript tags are present.)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Thank you very much. It would be great if this could be done. ❤️
---Original--- From: "Sergiy Yavorsky"<[email protected]> Date: 2020/11/26 01:47:01 To: "syavorsky/comment-parser"<[email protected]>; Cc: "EvanOne(文一)"<[email protected]>;"Author"<[email protected]>; Subject: Re: [syavorsky/comment-parser] [Feature Request]: Add option to set MARKER_START and MARKER_START_SKIP. (#97)
This is reasonable suggestion, I will try to make it configurable in upcoming 1.0
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.