mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-08 23:25:01 -04:00
Add support for extracting Google Doc ID from /preview URLs in parse.ts.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@compass/api",
|
||||
"version": "1.36.2",
|
||||
"version": "1.36.3",
|
||||
"private": true,
|
||||
"description": "Backend API endpoints",
|
||||
"main": "src/serve.ts",
|
||||
|
||||
@@ -524,6 +524,7 @@ function cleanHref(href: string): string {
|
||||
export function extractGoogleDocId(url: string) {
|
||||
const patterns = [
|
||||
/\/document\/d\/([a-zA-Z0-9-_]+)\/edit/, // standard /d/{id}/edit format
|
||||
/\/document\/d\/([a-zA-Z0-9-_]+)\/preview/, // standard /d/{id}/preview format
|
||||
// /id=([a-zA-Z0-9-_]+)/, // ?id= query param format (catches false negatives)
|
||||
// /^([a-zA-Z0-9-_]+)$/, // raw ID passed directly (catches false negatives)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user