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

Conversation

Josmithr
Copy link
Contributor

Optimizes rendering of empty table cells in Markdown to omit only a single space instead of two.

The primary goal of this PR is to align our Markdown rendering with the behavior of mdast-util-to-markdown, which we plan to use to replace our custom Markdown rendering.

@Josmithr Josmithr requested review from alexvy86, jumyhre, RishhiB, a team and Copilot June 10, 2025 19:18
@github-actions github-actions bot added the base: main PRs targeted against main branch label Jun 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Markdown table row renderer to output a single space for empty cells, matching mdast-util-to-markdown behavior.

  • Simplifies empty cell output by writing only a pipe and minimal spaces.
  • Adjusts spacing logic to omit the extra space after empty cells.
Comments suppressed due to low confidence (1)

tools/api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/RenderTableRow.ts:28

  • Add or update unit tests to cover rendering of empty table cells, ensuring the new single-space behavior matches mdast-util-to-markdown exactly.
if (child.isEmpty) {

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  222981 links
    1707 destination URLs
    1939 URLs ignored
       0 warnings
       0 errors


@Josmithr Josmithr merged commit 807baea into microsoft:main Jun 10, 2025
33 checks passed
@Josmithr Josmithr deleted the api-markdown-documenter/simplify-empty-table-cell-rendering branch June 10, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants