Skip to content

improvement(api-markdown-documenter): Simplify empty table cell rendering in Markdown #24814

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

Merged
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
@@ -24,11 +24,19 @@ export function renderTableRow(
writer.write("| ");
for (let i = 0; i < node.children.length; i++) {
const child = node.children[i];
renderNode(child, writer, {
...context,
insideTable: true,
});
writer.write(i === node.children.length - 1 ? " |" : " | ");

if (child.isEmpty) {
writer.write("|");
} else {
renderNode(child, writer, {
...context,
insideTable: true,
});
writer.write(" |");
}
if (i < node.children.length - 1) {
writer.write(" ");
}
}
writer.ensureNewLine(); // Ensure line break after row
}
Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@
| Package | Description |
| - | - |
| [test-suite-a](/test-suite-a/) | Test package |
| [test-suite-b](/test-suite-b/) | |
| [test-suite-b](/test-suite-b/) | |
Original file line number Diff line number Diff line change
@@ -73,21 +73,21 @@ const foo = bar;
| Function | Alerts | Return Type | Description |
| - | - | - | - |
| [testFunction(testParameter, testOptionalParameter)](/test-suite-a/testfunction-function) | `Alpha` | TTypeParameter | Test function |
| [testFunctionReturningInlineType()](/test-suite-a/testfunctionreturninginlinetype-function) | | { foo: number; bar: [TestEnum](/test-suite-a/testenum-enum/); } | Test function that returns an inline type |
| [testFunctionReturningInlineType()](/test-suite-a/testfunctionreturninginlinetype-function) | | { foo: number; bar: [TestEnum](/test-suite-a/testenum-enum/); } | Test function that returns an inline type |
| [testFunctionReturningIntersectionType()](/test-suite-a/testfunctionreturningintersectiontype-function) | `Deprecated` | [TestEmptyInterface](/test-suite-a/testemptyinterface-interface/) \& [TestInterfaceWithTypeParameter](/test-suite-a/testinterfacewithtypeparameter-interface/)\<number\> | Test function that returns an inline type |
| [testFunctionReturningUnionType()](/test-suite-a/testfunctionreturninguniontype-function) | | string \| [TestInterface](/test-suite-a/testinterface-interface/) | Test function that returns an inline type |
| [testFunctionReturningUnionType()](/test-suite-a/testfunctionreturninguniontype-function) | | string \| [TestInterface](/test-suite-a/testinterface-interface/) | Test function that returns an inline type |

## Variables

| Variable | Alerts | Modifiers | Type | Description |
| - | - | - | - | - |
| [testConst](/test-suite-a/testconst-variable) | `Beta` | `readonly` | | Test Constant |
| [testConst](/test-suite-a/testconst-variable) | `Beta` | `readonly` | | Test Constant |
| [testConstWithEmptyDeprecatedBlock](/test-suite-a/testconstwithemptydeprecatedblock-variable) | `Deprecated` | `readonly` | string | I have a `@deprecated` tag with an empty comment block. |

## Namespaces

| Namespace | Alerts | Description |
| - | - | - |
| [TestBetaNamespace](/test-suite-a/testbetanamespace-namespace/) | `Beta` | A namespace tagged as `@beta`. |
| [TestModule](/test-suite-a/testmodule-namespace/) | | |
| [TestNamespace](/test-suite-a/testnamespace-namespace/) | | Test Namespace |
| [TestModule](/test-suite-a/testmodule-namespace/) | | |
| [TestNamespace](/test-suite-a/testnamespace-namespace/) | | Test Namespace |
Original file line number Diff line number Diff line change
@@ -14,5 +14,5 @@ protected constructor(privateProperty: number, protectedProperty: TestEnum);

| Parameter | Type | Description |
| - | - | - |
| privateProperty | number | |
| protectedProperty | [TestEnum](/test-suite-a/testenum-enum/) | |
| privateProperty | number | |
| protectedProperty | [TestEnum](/test-suite-a/testenum-enum/) | |
Original file line number Diff line number Diff line change
@@ -27,6 +27,6 @@ export declare abstract class TestAbstractClass

| Method | Modifiers | Return Type | Description |
| - | - | - | - |
| [publicAbstractMethod()](/test-suite-a/testabstractclass-class/publicabstractmethod-method) | | void | A test public abstract method. |
| [publicAbstractMethod()](/test-suite-a/testabstractclass-class/publicabstractmethod-method) | | void | A test public abstract method. |
| [sealedMethod()](/test-suite-a/testabstractclass-class/sealedmethod-method) | `sealed` | string | A test `@sealed` method. |
| [virtualMethod()](/test-suite-a/testabstractclass-class/virtualmethod-method) | `virtual` | number | A test `@virtual` method. |
Original file line number Diff line number Diff line change
@@ -20,6 +20,6 @@ Tests release level inheritance.

| Variable | Alerts | Modifiers | Type | Description |
| - | - | - | - | - |
| [alphaMember](/test-suite-a/testbetanamespace-namespace/alphamember-variable) | `Alpha` | `readonly` | | |
| [betaMember](/test-suite-a/testbetanamespace-namespace/betamember-variable) | `Beta` | `readonly` | | |
| [publicMember](/test-suite-a/testbetanamespace-namespace/publicmember-variable) | `Beta` | `readonly` | | |
| [alphaMember](/test-suite-a/testbetanamespace-namespace/alphamember-variable) | `Alpha` | `readonly` | | |
| [betaMember](/test-suite-a/testbetanamespace-namespace/betamember-variable) | `Beta` | `readonly` | | |
| [publicMember](/test-suite-a/testbetanamespace-namespace/publicmember-variable) | `Beta` | `readonly` | | |
Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ Here are some remarks about the class

| Method | Modifiers | Return Type | Description |
| - | - | - | - |
| [publicAbstractMethod()](/test-suite-a/testclass-class/publicabstractmethod-method) | | void | A test public abstract method. |
| [publicAbstractMethod()](/test-suite-a/testclass-class/publicabstractmethod-method) | | void | A test public abstract method. |
| [testClassMethod(input)](/test-suite-a/testclass-class/testclassmethod-method) | `sealed` | TTypeParameterA | Test class method |
| [virtualMethod()](/test-suite-a/testclass-class/virtualmethod-method) | | number | Overrides [virtualMethod()](/test-suite-a/testabstractclass-class/virtualmethod-method). |
| [virtualMethod()](/test-suite-a/testclass-class/virtualmethod-method) | | number | Overrides [virtualMethod()](/test-suite-a/testabstractclass-class/virtualmethod-method). |

## See Also {#testclass-see-also}

Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ Here are some remarks about the method

| Parameter | Type | Description |
| - | - | - |
| input | TTypeParameterA | |
| input | TTypeParameterA | |

## Returns {#testclassmethod-returns}

Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@ This is a test [link](/test-suite-a/testinterface-interface/) to another API mem

| Parameter | Modifiers | Type | Description |
| - | - | - | - |
| testParameter | | TTypeParameter | A test parameter |
| testOptionalParameter | optional | TTypeParameter | |
| testParameter | | TTypeParameter | A test parameter |
| testOptionalParameter | optional | TTypeParameter | |

## Returns {#testfunction-returns}

Original file line number Diff line number Diff line change
@@ -30,10 +30,10 @@ Here are some remarks about the interface

| Property | Modifiers | Default Value | Type | Description |
| - | - | - | - | - |
| [getterProperty](/test-suite-a/testinterface-interface/getterproperty-property) | `readonly` | | boolean | A test getter-only interface property. |
| [propertyWithBadInheritDocTarget](/test-suite-a/testinterface-interface/propertywithbadinheritdoctarget-propertysignature) | | | boolean | |
| [setterProperty](/test-suite-a/testinterface-interface/setterproperty-property) | | | boolean | A test property with a getter and a setter. |
| [testInterfaceProperty](/test-suite-a/testinterface-interface/testinterfaceproperty-propertysignature) | | | number | Test interface property |
| [getterProperty](/test-suite-a/testinterface-interface/getterproperty-property) | `readonly` | | boolean | A test getter-only interface property. |
| [propertyWithBadInheritDocTarget](/test-suite-a/testinterface-interface/propertywithbadinheritdoctarget-propertysignature) | | | boolean | |
| [setterProperty](/test-suite-a/testinterface-interface/setterproperty-property) | | | boolean | A test property with a getter and a setter. |
| [testInterfaceProperty](/test-suite-a/testinterface-interface/testinterfaceproperty-propertysignature) | | | number | Test interface property |
| [testOptionalInterfaceProperty](/test-suite-a/testinterface-interface/testoptionalinterfaceproperty-propertysignature) | `optional` | 0 | number | Test optional property |

## Methods
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@

| Variable | Modifiers | Type | Description |
| - | - | - | - |
| [foo](/test-suite-a/testmodule-namespace/foo-variable) | `readonly` | | Test constant in module. |
| [foo](/test-suite-a/testmodule-namespace/foo-variable) | `readonly` | | Test constant in module. |
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ const foo = {

| Variable | Alerts | Modifiers | Type | Description |
| - | - | - | - | - |
| [TestConst](/test-suite-a/testnamespace-namespace/testconst-variable) | `Beta` | `readonly` | | Test Constant |
| [TestConst](/test-suite-a/testnamespace-namespace/testconst-variable) | `Beta` | `readonly` | | Test Constant |

## Namespaces

Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ function testFunction(testParameter: number): number;

| Parameter | Type | Description |
| - | - | - |
| testParameter | number | |
| testParameter | number | |

## Returns {#testfunction-returns}

Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@
| Package | Description |
| - | - |
| [test-suite-a](/test-suite-a/) | Test package |
| [test-suite-b](/test-suite-b/) | |
| [test-suite-b](/test-suite-b/) | |
Original file line number Diff line number Diff line change
@@ -73,24 +73,24 @@ const foo = bar;
| Function | Alerts | Return Type | Description |
| - | - | - | - |
| [testFunction(testParameter, testOptionalParameter)](/test-suite-a/#testfunction-function) | `Alpha` | TTypeParameter | Test function |
| [testFunctionReturningInlineType()](/test-suite-a/#testfunctionreturninginlinetype-function) | | { foo: number; bar: [TestEnum](/test-suite-a/testenum-enum); } | Test function that returns an inline type |
| [testFunctionReturningInlineType()](/test-suite-a/#testfunctionreturninginlinetype-function) | | { foo: number; bar: [TestEnum](/test-suite-a/testenum-enum); } | Test function that returns an inline type |
| [testFunctionReturningIntersectionType()](/test-suite-a/#testfunctionreturningintersectiontype-function) | `Deprecated` | [TestEmptyInterface](/test-suite-a/testemptyinterface-interface) \& [TestInterfaceWithTypeParameter](/test-suite-a/testinterfacewithtypeparameter-interface)\<number\> | Test function that returns an inline type |
| [testFunctionReturningUnionType()](/test-suite-a/#testfunctionreturninguniontype-function) | | string \| [TestInterface](/test-suite-a/testinterface-interface) | Test function that returns an inline type |
| [testFunctionReturningUnionType()](/test-suite-a/#testfunctionreturninguniontype-function) | | string \| [TestInterface](/test-suite-a/testinterface-interface) | Test function that returns an inline type |

## Variables

| Variable | Alerts | Modifiers | Type | Description |
| - | - | - | - | - |
| [testConst](/test-suite-a/#testconst-variable) | `Beta` | `readonly` | | Test Constant |
| [testConst](/test-suite-a/#testconst-variable) | `Beta` | `readonly` | | Test Constant |
| [testConstWithEmptyDeprecatedBlock](/test-suite-a/#testconstwithemptydeprecatedblock-variable) | `Deprecated` | `readonly` | string | I have a `@deprecated` tag with an empty comment block. |

## Namespaces

| Namespace | Alerts | Description |
| - | - | - |
| [TestBetaNamespace](/test-suite-a/testbetanamespace-namespace/) | `Beta` | A namespace tagged as `@beta`. |
| [TestModule](/test-suite-a/testmodule-namespace/) | | |
| [TestNamespace](/test-suite-a/testnamespace-namespace/) | | Test Namespace |
| [TestModule](/test-suite-a/testmodule-namespace/) | | |
| [TestNamespace](/test-suite-a/testnamespace-namespace/) | | Test Namespace |

## Function Details

@@ -120,8 +120,8 @@ This is a test [link](/test-suite-a/testinterface-interface) to another API memb

| Parameter | Modifiers | Type | Description |
| - | - | - | - |
| testParameter | | TTypeParameter | A test parameter |
| testOptionalParameter | optional | TTypeParameter | |
| testParameter | | TTypeParameter | A test parameter |
| testOptionalParameter | optional | TTypeParameter | |

#### Returns {#testfunction-returns}

Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ export declare abstract class TestAbstractClass

| Method | Modifiers | Return Type | Description |
| - | - | - | - |
| [publicAbstractMethod()](/test-suite-a/testabstractclass-class#publicabstractmethod-method) | | void | A test public abstract method. |
| [publicAbstractMethod()](/test-suite-a/testabstractclass-class#publicabstractmethod-method) | | void | A test public abstract method. |
| [sealedMethod()](/test-suite-a/testabstractclass-class#sealedmethod-method) | `sealed` | string | A test `@sealed` method. |
| [virtualMethod()](/test-suite-a/testabstractclass-class#virtualmethod-method) | `virtual` | number | A test `@virtual` method. |

@@ -47,8 +47,8 @@ protected constructor(privateProperty: number, protectedProperty: TestEnum);

| Parameter | Type | Description |
| - | - | - |
| privateProperty | number | |
| protectedProperty | [TestEnum](/test-suite-a/testenum-enum) | |
| privateProperty | number | |
| protectedProperty | [TestEnum](/test-suite-a/testenum-enum) | |

## Property Details

Original file line number Diff line number Diff line change
@@ -20,9 +20,9 @@ Tests release level inheritance.

| Variable | Alerts | Modifiers | Type | Description |
| - | - | - | - | - |
| [alphaMember](/test-suite-a/testbetanamespace-namespace/#alphamember-variable) | `Alpha` | `readonly` | | |
| [betaMember](/test-suite-a/testbetanamespace-namespace/#betamember-variable) | `Beta` | `readonly` | | |
| [publicMember](/test-suite-a/testbetanamespace-namespace/#publicmember-variable) | `Beta` | `readonly` | | |
| [alphaMember](/test-suite-a/testbetanamespace-namespace/#alphamember-variable) | `Alpha` | `readonly` | | |
| [betaMember](/test-suite-a/testbetanamespace-namespace/#betamember-variable) | `Beta` | `readonly` | | |
| [publicMember](/test-suite-a/testbetanamespace-namespace/#publicmember-variable) | `Beta` | `readonly` | | |

## Variable Details

Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ Here are some remarks about the class

| Method | Modifiers | Return Type | Description |
| - | - | - | - |
| [publicAbstractMethod()](/test-suite-a/testclass-class#publicabstractmethod-method) | | void | A test public abstract method. |
| [publicAbstractMethod()](/test-suite-a/testclass-class#publicabstractmethod-method) | | void | A test public abstract method. |
| [testClassMethod(input)](/test-suite-a/testclass-class#testclassmethod-method) | `sealed` | TTypeParameterA | Test class method |
| [virtualMethod()](/test-suite-a/testclass-class#virtualmethod-method) | | number | Overrides [virtualMethod()](/test-suite-a/testabstractclass-class#virtualmethod-method). |
| [virtualMethod()](/test-suite-a/testclass-class#virtualmethod-method) | | number | Overrides [virtualMethod()](/test-suite-a/testabstractclass-class#virtualmethod-method). |

## Constructor Details

@@ -197,7 +197,7 @@ Here are some remarks about the method

| Parameter | Type | Description |
| - | - | - |
| input | TTypeParameterA | |
| input | TTypeParameterA | |

#### Returns {#testclassmethod-returns}

Original file line number Diff line number Diff line change
@@ -30,10 +30,10 @@ Here are some remarks about the interface

| Property | Modifiers | Default Value | Type | Description |
| - | - | - | - | - |
| [getterProperty](/test-suite-a/testinterface-interface#getterproperty-property) | `readonly` | | boolean | A test getter-only interface property. |
| [propertyWithBadInheritDocTarget](/test-suite-a/testinterface-interface#propertywithbadinheritdoctarget-propertysignature) | | | boolean | |
| [setterProperty](/test-suite-a/testinterface-interface#setterproperty-property) | | | boolean | A test property with a getter and a setter. |
| [testInterfaceProperty](/test-suite-a/testinterface-interface#testinterfaceproperty-propertysignature) | | | number | Test interface property |
| [getterProperty](/test-suite-a/testinterface-interface#getterproperty-property) | `readonly` | | boolean | A test getter-only interface property. |
| [propertyWithBadInheritDocTarget](/test-suite-a/testinterface-interface#propertywithbadinheritdoctarget-propertysignature) | | | boolean | |
| [setterProperty](/test-suite-a/testinterface-interface#setterproperty-property) | | | boolean | A test property with a getter and a setter. |
| [testInterfaceProperty](/test-suite-a/testinterface-interface#testinterfaceproperty-propertysignature) | | | number | Test interface property |
| [testOptionalInterfaceProperty](/test-suite-a/testinterface-interface#testoptionalinterfaceproperty-propertysignature) | `optional` | 0 | number | Test optional property |

## Methods
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

| Variable | Modifiers | Type | Description |
| - | - | - | - |
| [foo](/test-suite-a/testmodule-namespace/#foo-variable) | `readonly` | | Test constant in module. |
| [foo](/test-suite-a/testmodule-namespace/#foo-variable) | `readonly` | | Test constant in module. |

## Variable Details

Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ const foo = {

| Variable | Alerts | Modifiers | Type | Description |
| - | - | - | - | - |
| [TestConst](/test-suite-a/testnamespace-namespace/#testconst-variable) | `Beta` | `readonly` | | Test Constant |
| [TestConst](/test-suite-a/testnamespace-namespace/#testconst-variable) | `Beta` | `readonly` | | Test Constant |

## Namespaces

@@ -92,7 +92,7 @@ function testFunction(testParameter: number): number;

| Parameter | Type | Description |
| - | - | - |
| testParameter | number | |
| testParameter | number | |

#### Returns {#testfunction-returns}

Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@
| Package | Description |
| - | - |
| [test-suite-a](docs/test-suite-a) | Test package |
| [test-suite-b](docs/test-suite-b) | |
| [test-suite-b](docs/test-suite-b) | |
Loading
Loading