Skip to content

Commit 769dead

Browse files
committed
feat: add support for markdown extension in readme files
1 parent 1ffdc05 commit 769dead

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/utils/file-icons.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ const FILENAME_ICONS: Record<string, string> = {
249249
'README': 'i-vscode-icons-file-type-markdown',
250250
'README.md': 'i-vscode-icons-file-type-markdown',
251251
'readme.md': 'i-vscode-icons-file-type-markdown',
252-
'Readme.md': 'i-vscode-icons-file-type-markdown',
252+
'README.markdown': 'i-vscode-icons-file-type-markdown',
253+
'readme.markdown': 'i-vscode-icons-file-type-markdown',
253254
'CHANGELOG': 'i-vscode-icons-file-type-markdown',
254255
'CHANGELOG.md': 'i-vscode-icons-file-type-markdown',
255256
'changelog.md': 'i-vscode-icons-file-type-markdown',

server/api/registry/readme/[...pkg].get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function fetchReadmeFromJsdelivr(
1414
packageName: string,
1515
version?: string,
1616
): Promise<string | null> {
17-
const filenames = ['README.md', 'readme.md', 'Readme.md', 'README', 'readme']
17+
const filenames = ['README.md', 'readme.md', 'Readme.md', 'README', 'readme', 'README.markdown', 'readme.markdown']
1818
const versionSuffix = version ? `@${version}` : ''
1919

2020
for (const filename of filenames) {

server/utils/code-highlight.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const FILENAME_MAP: Record<string, string> = {
7474
'CHANGELOG.md': 'markdown',
7575
'README': 'markdown',
7676
'README.md': 'markdown',
77+
'README.markdown': 'markdown',
7778
}
7879

7980
/**

0 commit comments

Comments
 (0)