Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the carrot (`) from the parseParams regex? #10

Open
tunnckoCore opened this issue Jan 18, 2017 · 4 comments
Open

Remove the carrot (`) from the parseParams regex? #10

tunnckoCore opened this issue Jan 18, 2017 · 4 comments

Comments

@tunnckoCore
Copy link

tunnckoCore commented Jan 18, 2017

It can be found at https://github.com/jonschlinkert/parse-comments/blob/master/index.js#L126. And the intention of that is because it is not standard jsdoc, so syntax highlighting is different.

source code

/**
 * > Make an array from any value.
 *
 * @param  {Any} `val` some long description
 * @return {Array}
 * @api private
 */

let arrayify = (val) => {
  if (!val) return []
  if (Array.isArray(val)) return val
  return [val]
}

without carrot

2017-01-18-19 36 58_445x309_scrot

with carrot

2017-01-18-19 37 35_481x296_scrot

notice the val

More better would be to wrap with ` later, instead of relay on that

@jonschlinkert
Copy link
Owner

In a future version, you will be able to customize this to be like js-doc. Although I personally dislike that format because it's not clear to readers or parsers what's really intended. There are always exceptions where js-doc is wrong.

@tunnckoCore
Copy link
Author

tunnckoCore commented Nov 24, 2018

it's not clear to readers or parsers what's really intended

What's not clear? It's always "the thing between the end of type and start of description. Whatever it be, it's always between two spaces.

I'll try later the whole v1 to see what's done.

@jonschlinkert
Copy link
Owner

It's always "the thing between the end of type and start of description.

Only on certain tags. Which is irritating, because it's not documented well. There is no official specification that I'm aware of. I tested hundreds of tags against 5 or 6 popular libs and the results were inconsistent.

@jonschlinkert
Copy link
Owner

I'll try later the whole v1 to see what's done.

Great! Fwiw you might find this helpful: https://github.com/jonschlinkert/parse-comments/blob/master/docs/content/comparison.md. The "type" parsing was one of the most complicated parts of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants