-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
Version: jsii@5.5.10 (via jsii-docgen@10.5.5)
Originally opened here
Summary
When using jsii-docgen in json mode, multi-line @link
elements are mangled.
Description
I have some documentation like the following (note the multi-line tsdoc @link
in the first line):
/**
* Matches the content of a variable that comes from a state. See {@link https://case.contract-testing.io/docs/defining-contracts/state-definitions | state
* definitions}
* and {@link https://case.contract-testing.io/docs/reference/state-handlers | state handlers} for
* more details.
*
* @public
*/
export class StateVariable extends AnyMatcher {
/* ... */
}
The generated remarks
section in the json doc is mangled - it assumed the first link finishes at the end of the first line, so the text link ends state} * definitions }
.
Expected behaviour
The parsed link appears as:
See {@link https://case.contract-testing.io/docs/defining-contracts/state-definitions state definitions}
Actual behaviour
The link appears as
See {@link https://case.contract-testing.io/docs/defining-contracts/state-definitions state} * definitions}
Note that:
- The link ends twice, once after
state
, and again afterdefinitions
- The
*
from the next line is erroneously included
Reproduction
I've created this repository illustrating this and another problem (about to be reported).
The relevant part for this issue is the parsing of this line:
/**
* This class reproduces the bugs at {@link https://github.com/cdklabs/jsii-docgen/issues/1633 | this
* issue}
Which results in this line in the assembly, which contains:
{@link https://github.com/cdklabs/jsii-docgen/issues/1633 this } * issue}