tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

DeclarationReference: Parser allows unquoted spaces

Open octogonz opened this issue 6 years ago • 1 comments

(Issue https://github.com/microsoft/tsdoc/issues/174 was mostly solved by PR https://github.com/microsoft/tsdoc/pull/177, so I'm creating a new issue to track this issue with spaces.)

Repro:

// (Actual) a.b c.d
// (Expected) SyntaxError
console.log(DeclarationReference.parse('a.b c.d').toString());

Since the DeclarationReference.parse() accepts escaped input, the parser should require the input to be quoted as a."b c".d. @rbuckton does that sound right?

octogonz avatar Aug 07 '19 23:08 octogonz

Hmm... In the current implementation, DeclarationReference.parse('a.b c.d').toString() outputs "a.b c.d".

octogonz avatar Dec 09 '19 00:12 octogonz