Skip to content

Comments

fix: support table attrs in readme#1329

Merged
danielroe merged 1 commit intonpmx-dev:mainfrom
alexdln:fix/support-table-attrs-in-readme
Feb 10, 2026
Merged

fix: support table attrs in readme#1329
danielroe merged 1 commit intonpmx-dev:mainfrom
alexdln:fix/support-table-attrs-in-readme

Conversation

@alexdln
Copy link
Member

@alexdln alexdln commented Feb 10, 2026

Added support for two fields that are supported in other systems but not in our: width and valign for th and td.

  • valign is deprecated, but still used
  • Also tested width with different values ​​- it works within the container

Closes #1093 (sorry, I missed this part, checked bunch more popular libraries and hopefully we're close to other apps now)

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 10, 2026 11:47am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 10, 2026 11:47am
npmx-lunaria Ignored Ignored Feb 10, 2026 11:47am

Request Review

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

This PR expands the allowed HTML attributes in the sanitiser configuration for table elements. Specifically, it adds 'valign' and 'width' attributes to both table header (th) and table data (td) elements in the sanitiser configuration within server/utils/readme.ts. This enables README files to preserve table formatting attributes that were previously stripped during sanitisation.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR partially addresses issue #1093 by adding table cell attributes (width, valign), but does not fully resolve the issue's broader objectives regarding centred headings, floating images, and other alignment attributes. Verify whether additional attributes for alignment (align, text-align) and image positioning are required to fully resolve issue #1093, or if this PR represents a phased approach.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the changes made: adding support for 'width' and 'valign' attributes for table cells, with relevant context about deprecation and testing.
Out of Scope Changes check ✅ Passed The changes are scoped to the readme sanitiser configuration for table cell attributes only, with no unrelated modifications to other files or functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe danielroe added this pull request to the merge queue Feb 10, 2026
Merged via the queue into npmx-dev:main with commit f345226 Feb 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Allowed DOM elements and attributes less permissive than npm

2 participants