Skip to content

fix: extract label from image-only playground links#1462

Merged
danielroe merged 3 commits intonpmx-dev:mainfrom
rzzf:fix/playground-label
Feb 13, 2026
Merged

fix: extract label from image-only playground links#1462
danielroe merged 3 commits intonpmx-dev:mainfrom
rzzf:fix/playground-label

Conversation

@rzzf
Copy link
Contributor

@rzzf rzzf commented Feb 13, 2026

https://npmx.dev/package/element-plus

Fixes an issue where playground links containing only an image (e.g. [![alt](img)](url)) resulted in a null label. Now uses the image's alt text as the label in such cases.

@vercel
Copy link

vercel bot commented Feb 13, 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 13, 2026 11:30am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 13, 2026 11:30am
npmx-lunaria Ignored Ignored Feb 13, 2026 11:30am

Request Review

@codecov
Copy link

codecov bot commented Feb 13, 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 13, 2026

📝 Walkthrough

Walkthrough

The PR updates renderer.link in server/utils/readme.ts so that plainText is computed as a mutable value and, if empty, falls back to the text of a single image token when the link contains only that image. The data-title-intermediate attribute is only added when plainText or title is non-empty. A unit test is added to verify extraction of a label from an image-based CodeSandbox link.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (5 files):

⚔️ i18n/locales/es.json (content)
⚔️ lunaria/files/es-419.json (content)
⚔️ lunaria/files/es-ES.json (content)
⚔️ server/utils/readme.ts (content)
⚔️ test/unit/server/utils/readme.spec.ts (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description directly addresses the changeset, explaining the specific issue with image-only playground links and the solution implemented.

✏️ 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
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch fix/playground-label
  • Post resolved changes as copyable diffs 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
Copy link
Member

it could further fall back to the provider name, e.g. 'codesandbox' in the case above

@rzzf
Copy link
Contributor Author

rzzf commented Feb 13, 2026

done

@danielroe danielroe enabled auto-merge February 13, 2026 11:29
@danielroe danielroe added this pull request to the merge queue Feb 13, 2026
Merged via the queue into npmx-dev:main with commit ae62f9c Feb 13, 2026
17 checks passed
@rzzf rzzf deleted the fix/playground-label branch February 13, 2026 11:36
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.

2 participants