Skip to content

[api-documenter] Ensure empty line after tables #5256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Expand Up @@ -136,7 +136,7 @@ export class CustomMarkdownEmitter extends MarkdownEmitter {
}
writer.write('</tbody>');
writer.write('</table>');
writer.writeLine();
writer.ensureSkippedLine();

break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ test('render Markdown from TSDoc', () => {
)
]);

output.appendNodes([
new DocHeading({ configuration, title: 'After a table' }),
new DocParagraph({ configuration }, [
new DocPlainText({ configuration, text: 'just checking lines after a table' }),
])
]);

const stringBuilder: StringBuilder = new StringBuilder();
const apiModel: ApiModel = new ApiModel();
const markdownEmitter: CustomMarkdownEmitter = new CustomMarkdownEmitter(apiModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@ Cell 2

</td></tr>
</tbody></table>

## After a table

just checking lines after a table

"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ Some overload. Overrides `Class3.someOverload`<!-- -->.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ boolean \| string

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ Some overload.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ boolean

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ Some prop.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ A third prop.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ Some prop.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ Some prop.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,4 @@ Some interface-like type alias.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,4 @@ Some overload.

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ boolean \| string

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ boolean

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ string

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Description

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ Description

</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,7 @@ Some abstract method.

</td></tr>
</tbody></table>

",
"/api-documenter-test.abstractclass.method.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -1504,6 +1505,7 @@ The date when the record was created.

</td></tr>
</tbody></table>

",
"/api-documenter-test.defaulttype.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -1580,6 +1582,7 @@ number

</td></tr>
</tbody></table>

",
"/api-documenter-test.docbaseclass.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -1643,6 +1646,7 @@ The overloaded constructor for \`DocBaseClass\`

</td></tr>
</tbody></table>

",
"/api-documenter-test.docclass1.deprecatedexample.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -1730,6 +1734,7 @@ the second string

</td></tr>
</tbody></table>

**Returns:**

string
Expand Down Expand Up @@ -1790,6 +1795,7 @@ the number

</td></tr>
</tbody></table>

**Returns:**

number
Expand Down Expand Up @@ -1844,6 +1850,7 @@ some generic parameter.

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down Expand Up @@ -2252,6 +2259,7 @@ An example with tables:

</td></tr>
</tbody></table>

",
"/api-documenter-test.docclass1.modifiedevent.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -2330,6 +2338,7 @@ _(Optional)_ the number

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down Expand Up @@ -2440,6 +2449,7 @@ the second number to add

</td></tr>
</tbody></table>

**Returns:**

number
Expand Down Expand Up @@ -2617,6 +2627,7 @@ These are some docs for Zero

</td></tr>
</tbody></table>

",
"/api-documenter-test.docenumnamespacemerge.examplefunction.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -2675,6 +2686,7 @@ This is a function inside of a namespace that merges with an enum.

</td></tr>
</tbody></table>

",
"/api-documenter-test.ecmasymbols.example.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -2729,6 +2741,7 @@ An ECMAScript symbol

</td></tr>
</tbody></table>

",
"/api-documenter-test.exampleduplicatetypealias.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -2811,6 +2824,7 @@ a system type that should NOT get hyperlinked

</td></tr>
</tbody></table>

**Returns:**

[IDocInterface1](./api-documenter-test.idocinterface1.md)
Expand Down Expand Up @@ -2931,6 +2945,7 @@ Does something

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface1.regularproperty.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -3004,6 +3019,7 @@ Description

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface3.__not.a.symbol__.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -3173,6 +3189,7 @@ Construct signature

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface3.redundantquotes.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -3333,6 +3350,7 @@ a union type

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface4.numberorfunction.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -3419,6 +3437,7 @@ Property of type string that does something

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface5.regularproperty.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -3491,6 +3510,7 @@ T

</td></tr>
</tbody></table>

**Returns:**

T
Expand Down Expand Up @@ -3674,6 +3694,7 @@ Description

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface6.regularproperty.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -3848,6 +3869,7 @@ _(Optional)_ Description of optionalMember

</td></tr>
</tbody></table>

",
"/api-documenter-test.idocinterface7.optionalfield.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -4365,6 +4387,7 @@ A type alias that references multiple other types.

</td></tr>
</tbody></table>

",
"/api-documenter-test.outernamespace.innernamespace.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -4405,6 +4428,7 @@ A function inside a namespace

</td></tr>
</tbody></table>

",
"/api-documenter-test.outernamespace.innernamespace.nestedfunction.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -4453,6 +4477,7 @@ number

</td></tr>
</tbody></table>

**Returns:**

number
Expand Down Expand Up @@ -4523,6 +4548,7 @@ A variable exported from within a namespace.

</td></tr>
</tbody></table>

",
"/api-documenter-test.outernamespace.nestedvariable.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -4585,6 +4611,7 @@ handler

</td></tr>
</tbody></table>

**Returns:**

void
Expand Down Expand Up @@ -4638,6 +4665,7 @@ Adds an handler for the event.

</td></tr>
</tbody></table>

",
"/api-documenter-test.typealias.md": "<!-- Do not edit this file. It is automatically generated by API Documenter. -->

Expand Down Expand Up @@ -4702,6 +4730,7 @@ This project tests various documentation generation scenarios and doc comment sy

</td></tr>
</tbody></table>

",
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/api-documenter",
"comment": "[api-documenter] ensure a new line is inserted after rendering a table ",
"type": "patch"
}
],
"packageName": "@microsoft/api-documenter"
}