Skip to content
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

[api-documenter] Avoid putting markdown/text after an HTML tag #4926

Open
markus-incisive opened this issue Sep 17, 2024 · 0 comments
Open

Comments

@markus-incisive
Copy link

Summary

Sometimes, the generated Markdown has a closing HTML tag followed by text, without any blank lines in-between. This can mess up some Markdown engines, including GitHub and VSCode.

Repro steps

Given the following .d.ts code

/**
 * Adds two numbers.
 * @param a - The first number.
 * @param b - The second number.
 * @returns The sum.
 *
 * @public
 */
export declare function add(a: number, b: number): number;

running

> api-extractor run
> api-documenter markdown

results in

## Parameters

<table><thead><tr><th>
  <!-- ... -->
</tbody></table>
**Returns:**

number

The sum.

Since **Returns:** follows immediately after an HTML tag, it is not rendered properly.

VSCode:
{9946A45D-82DD-42F6-A23E-61DFD3A33FEE}

Details

This issue appears with pretty much any function with parameters. It can be fixed by adding a blank line.

Relevant issue: microsoft/vscode-markdown-tm-grammar#85

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-documenter version? 7.47.9
Operating system? Windows
Documentation target? Markdown
Would you consider contributing a PR? No
TypeScript compiler version? 5.6.2
Node.js version (node -v)? 22.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant