Skip to content

Commit 87ec4a7

Browse files
committed
Add support for extracting Google Doc ID from /preview URLs in parse.ts.
1 parent a62be51 commit 87ec4a7

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

backend/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compass/api",
3-
"version": "1.36.2",
3+
"version": "1.36.3",
44
"private": true,
55
"description": "Backend API endpoints",
66
"main": "src/serve.ts",

backend/shared/src/parse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ function cleanHref(href: string): string {
524524
export function extractGoogleDocId(url: string) {
525525
const patterns = [
526526
/\/document\/d\/([a-zA-Z0-9-_]+)\/edit/, // standard /d/{id}/edit format
527+
/\/document\/d\/([a-zA-Z0-9-_]+)\/preview/, // standard /d/{id}/preview format
527528
// /id=([a-zA-Z0-9-_]+)/, // ?id= query param format (catches false negatives)
528529
// /^([a-zA-Z0-9-_]+)$/, // raw ID passed directly (catches false negatives)
529530
]

0 commit comments

Comments
 (0)