From 6ed9647d247e840a78dc3b86e7dbfcec52d552fe Mon Sep 17 00:00:00 2001 From: garmoncheg Date: Wed, 6 Nov 2024 09:49:12 +0200 Subject: [PATCH] Append param only if title is true. --- plugins/domains/documentcloud.org.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index 0874566ef..5aff2ee6a 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -32,15 +32,17 @@ export default { if (!/DC\-note/.test(html) && !/DC\-embed(?:\-page)?/.test(html)) { var page = options.getRequestOptions('documentcloud.page', '1'); - var title = options.getRequestOptions('documentcloud.title', false); + var title = !!options.getRequestOptions('documentcloud.title', false); try { var iframe = oembed.getIframe(); var href = iframe.src; - var uri = new URL(href); - uri.searchParams.append("title", title ? '1': '0'); - href = uri.toString(); + if (title) { + var uri = new URL(href); + uri.searchParams.append("title", '1'); + href = uri.toString(); + } if (page && page !== '1') { if (href) {