Skip to content

Commit 2dad952

Browse files
author
ogmatrix
committed
fix: fixed category extraction to be universal
1 parent e925548 commit 2dad952

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/indexer/crawler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,9 @@ export class DocumentCrawler {
357357
* Extract category from URL
358358
*/
359359
private extractCategory(url: string): string {
360-
// eslint-disable-next-line no-useless-escape
361-
const match = url.match(/https?:\/\/[^\/]+\/(?:(?:\d+(?:\.\d+)*)\/)?(?:develop\/)?([^\/:]+)/);
360+
const match = url.match(
361+
/https?:\/\/[^/]+\/(?:.*\/)?(?:(?:\d+(?:\.\d+)*|develop)\/([^/]+)|([^/:\\s]+):)/
362+
);
362363
if (match) {
363364
return match[1] || 'general';
364365
}

0 commit comments

Comments
 (0)