-
Notifications
You must be signed in to change notification settings - Fork 709
[api-extractor] @example comment title line formatting is not preserved #4860
Copy link
Copy link
Open
Labels
bugSomething isn't working as intendedSomething isn't working as intendedeffort: easyProbably a quick fix. Want to contribute? :-)Probably a quick fix. Want to contribute? :-)help wantedIf you're looking to contribute, this issue is a good place to start!If you're looking to contribute, this issue is a good place to start!repro confirmedThe issue comments included repro instructions, and the maintainers reproduced the problemThe issue comments included repro instructions, and the maintainers reproduced the problem
Description
Activity
Metadata
Metadata
Assignees
Labels
bugSomething isn't working as intendedSomething isn't working as intendedeffort: easyProbably a quick fix. Want to contribute? :-)Probably a quick fix. Want to contribute? :-)help wantedIf you're looking to contribute, this issue is a good place to start!If you're looking to contribute, this issue is a good place to start!repro confirmedThe issue comments included repro instructions, and the maintainers reproduced the problemThe issue comments included repro instructions, and the maintainers reproduced the problem
Type
Projects
- StatusShow more project fieldsNeeds triage
Per the TSDoc spec,
@examplecomment blocks are intended to treat the first line (the text on the same line as the tag) as the example's "title".Unfortunately, the formatting information required to differentiate this line from other block contents are not preserved by API-Extractor.
For a TSDoc comment like the following:
The expected api.json contents would look like:
Instead, what is generated looks like the following:
API-Extractor seems to be injecting blank lines between the
@exampletag and the contents when none are present.This makes it impossible for consumers of the api.json files from differentiating
@examplecomments with titles from those without titles.Ideally, API-Extractor would not introduce these blank lines.
A sample repro can be found here: https://github.com/Josmithr/api-extractor-playground/tree/example-comment-bug-repro
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractorversion?node -v)?