Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/tsdoc",
"comment": "Ensure TSDocEmitter does not emit a newline for the text after `@defaultValue` tags.",
"type": "patch"
}
],
"packageName": "@microsoft/tsdoc"
}
5 changes: 4 additions & 1 deletion tsdoc/src/emitters/TSDocEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export class TSDocEmitter {
this._ensureLineSkipped();
this._renderNode(docBlock.blockTag);

if (docBlock.blockTag.tagNameWithUpperCase === StandardTags.returns.tagNameWithUpperCase) {
if (
docBlock.blockTag.tagNameWithUpperCase === StandardTags.returns.tagNameWithUpperCase ||
docBlock.blockTag.tagNameWithUpperCase === StandardTags.defaultValue.tagNameWithUpperCase
) {
this._writeContent(' ');
this._hangingParagraph = true;
}
Expand Down
3 changes: 3 additions & 0 deletions tsdoc/src/emitters/__tests__/TSDocEmitter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ test('02 Emit a basic comment', () => {
* line1
* line2
* \`\`\`
* @defaultValue value
*
* @public @readonly
*/
Expand Down Expand Up @@ -114,6 +115,8 @@ Object {
* line2
* \`\`\`
*
* @defaultValue value
*
* @public @readonly
*/
",
Expand Down