Skip to content

Commit

Permalink
Append param only if title is true.
Browse files Browse the repository at this point in the history
  • Loading branch information
garmoncheg committed Nov 6, 2024
1 parent c9040b2 commit 6ed9647
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/domains/documentcloud.org.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6ed9647

Please sign in to comment.