sassdoc icon indicating copy to clipboard operation
sassdoc copied to clipboard

$ symbol in @require description.

Open MathiasSM opened this issue 8 years ago • 0 comments

The current regex:

^\s*(?:\{(.*)\})?\s*(?:(\$?[^\s]+))?\s*(?:-?\s*([^<$]*))?\s*(?:<?\s*(.*)\s*>)?$

Explicitly disallows using the $ symbol inside the description/comment section of a @require annotation. It is allowed in @returns and the like, so I wonder why it's not here.

That's my first issue. My second issue is that I had to look up in the code to figure out why SassDoc was crashing. I was using several annotations with the $, so pin-pointing the wrong line was impossible with just my code. It should throw a human-friendly error (which, being this a regex thing, could be quite a challenge to say "hey, no money here!", but could be easy to say "wrong syntax for description" or something... Instead of:

/Users/mathias/.nodenv/versions/6.9.5/lib/node_modules/sassdoc/dist/annotation/annotations/require.js:31
        type: match[1] || 'function',
                   ^

Don't you think?

MathiasSM avatar Sep 14 '17 02:09 MathiasSM