Skip to content

Commit d977ced

Browse files
committed
fix: remove double URL encoding
1 parent 5e9f7b4 commit d977ced

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

packages/nimiq-vitepress-theme/src/composables/useSourceCode.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -262,31 +262,22 @@ export function useSourceCode() {
262262
}
263263
}
264264

265-
const getRawMarkdownUrl = () => {
265+
const chatGPTUrl = computed(() => {
266266
const absoluteUrl = getAbsoluteMarkdownUrl()
267-
268267
if (!absoluteUrl)
269268
return ''
270269

271-
return encodeURIComponent(absoluteUrl)
272-
}
273-
274-
const chatGPTUrl = computed(() => {
275-
const rawUrl = getRawMarkdownUrl()
276-
if (!rawUrl)
277-
return ''
278-
279-
const message = `Read ${rawUrl} so I can ask questions about it.`
270+
const message = `Read ${absoluteUrl} so I can ask questions about it.`
280271
const encodedMessage = encodeURIComponent(message)
281272
return `https://chatgpt.com/?hints=search&q=${encodedMessage}`
282273
})
283274

284275
const claudeUrl = computed(() => {
285-
const rawUrl = getRawMarkdownUrl()
286-
if (!rawUrl)
276+
const absoluteUrl = getAbsoluteMarkdownUrl()
277+
if (!absoluteUrl)
287278
return ''
288279

289-
const message = `Read ${rawUrl} so I can ask questions about it.`
280+
const message = `Read ${absoluteUrl} so I can ask questions about it.`
290281
const encodedMessage = encodeURIComponent(message)
291282
return `https://claude.ai/new?q=${encodedMessage}`
292283
})

0 commit comments

Comments
 (0)