Skip to content

Commit 9e34c99

Browse files
fix(confluence): handle relative paths when extracting cursor from link
1 parent 5a3f4e5 commit 9e34c99

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

components/confluence/confluence.app.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,15 @@ export default {
146146
_extractCursorFromLink(link) {
147147
if (!link) return null;
148148
try {
149-
const url = new URL(link);
149+
// Handle cases where link might be just a path or relative URL
150+
let url;
151+
if (link.startsWith("http")) {
152+
url = new URL(link);
153+
} else {
154+
// If it's a path or relative URL, construct a full URL
155+
const baseUrl = "https://api.atlassian.com";
156+
url = new URL(link, baseUrl);
157+
}
150158
return url.searchParams.get("cursor");
151159
} catch (e) {
152160
console.log("Error extracting cursor from link:", e);

0 commit comments

Comments
 (0)