From 9af2ab4bd8d3894e385dbb853d82c414f03f2aef Mon Sep 17 00:00:00 2001 From: Idris Gadi Date: Sat, 7 Feb 2026 00:49:46 +0530 Subject: [PATCH 1/7] feat: add copy readme to markdown button --- server/api/registry/readme/[...pkg].get.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/registry/readme/[...pkg].get.ts b/server/api/registry/readme/[...pkg].get.ts index ca64a55c06..5b3c0f3120 100644 --- a/server/api/registry/readme/[...pkg].get.ts +++ b/server/api/registry/readme/[...pkg].get.ts @@ -107,7 +107,7 @@ export default defineCachedEventHandler( } if (!readmeContent || readmeContent === NPM_MISSING_README_SENTINEL) { - return { html: '', playgroundLinks: [], toc: [] } + return { html: '', md: '', playgroundLinks: [], toc: [] } } // Parse repository info for resolving relative URLs to GitHub From d5c69237b1aefa34afd7ba98de9e3d8efaf34d76 Mon Sep 17 00:00:00 2001 From: Idris Gadi Date: Sat, 7 Feb 2026 01:04:17 +0530 Subject: [PATCH 2/7] test: add a simple test --- test/unit/server/utils/readme.spec.ts | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/unit/server/utils/readme.spec.ts b/test/unit/server/utils/readme.spec.ts index 7790d4d042..881776b9ca 100644 --- a/test/unit/server/utils/readme.spec.ts +++ b/test/unit/server/utils/readme.spec.ts @@ -142,6 +142,42 @@ describe('Playground Link Extraction', () => { expect(result.playgroundLinks).toHaveLength(1) expect(result.playgroundLinks[0]!.provider).toBe('stackblitz') }) + + it('returns raw markdown content', async () => { + const markdown = `# Test Package + +## Installation + +\`\`\`bash +npm install test-package +\`\`\` + +## Usage + +This is a sample package for testing. + +> [!NOTE] +> This is a note callout. + +- Feature one +- Feature two +` + const result = await renderReadmeHtml(markdown, 'test-pkg') + + expect(result.markdown).toBe(markdown) + expect(result.markdown).toContain('# Test Package') + expect(result.markdown).toContain('## Installation') + expect(result.markdown).toContain('npm install test-package') + }) + + it('returns empty string for empty content', async () => { + const result = await renderReadmeHtml('', 'test-pkg') + + expect(result.markdown).toBe('') + expect(result.html).toBe('') + expect(result.playgroundLinks).toEqual([]) + expect(result.toc).toEqual([]) + }) }) }) From 787f4e617efa4690571e3e33f91bfce32d31ebef Mon Sep 17 00:00:00 2001 From: Idris Gadi Date: Sat, 7 Feb 2026 01:26:16 +0530 Subject: [PATCH 3/7] fix(style): remove redundant focus style --- app/components/ReadmeTocDropdown.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/ReadmeTocDropdown.vue b/app/components/ReadmeTocDropdown.vue index 67a9e9615f..2da8a13f64 100644 --- a/app/components/ReadmeTocDropdown.vue +++ b/app/components/ReadmeTocDropdown.vue @@ -148,7 +148,7 @@ function handleKeydown(event: KeyboardEvent) {