react-docgen-typescript
react-docgen-typescript copied to clipboard
@link in description broken if target can be resolved
Hi there,
when parsing JSDoc @link annotations with a link text set, the parser removes the space between the link target and the link text if the link's target can be resolved:
const MyOtherComponent = () => {};
/**
* My component. Similar to
* - {@link MyOtherComponent other component}.
* - {@link MyOtherComponent|other component}.
* - {@link MyOtherComponent2 other component 2}.
* - {@link MyOtherComponent2|other component 2}.
*/
export const Foo = () => <div>...</div>;
Output:
description: 'My component. Similar to\n' +
'- {@link MyOtherComponentother component}.\n' +
'- {@link MyOtherComponentother component}.\n' +
'- {@link MyOtherComponent2 other component 2}.\n' +
'- {@link MyOtherComponent2 other component 2}.',
Expected:
description: 'My component. Similar to\n' +
'- {@link MyOtherComponent other component}.\n' +
'- {@link MyOtherComponent other component}.\n' +
'- {@link MyOtherComponent2 other component 2}.\n' +
'- {@link MyOtherComponent2 other component 2}.',
Thanks for looking into it!