Skip to content

Commit c288453

Browse files
author
Al Manning
committed
escape titles for cql searches
1 parent d9abdcd commit c288453

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/publish/confluence/api/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export class ConfluenceClient {
7979
): Promise<Content[]> {
8080
const cqlContext =
8181
"%7B%22contentStatuses%22%3A%5B%22archived%22%2C%20%22current%22%2C%20%22draft%22%5D%7D"; //{"contentStatuses":["archived", "current", "draft"]}
82-
const cql = `title="${title}" and space=${space.key}&cqlcontext=${cqlContext}`;
82+
const encodedTitle = encodeURIComponent(title);
83+
const cql = `title="${encodedTitle}" and space=${space.key}&cqlcontext=${cqlContext}`;
8384
const result = await this.get<ContentArray>(`content/search?cql=${cql}`);
8485
return result?.results ?? [];
8586
}

0 commit comments

Comments
 (0)