Skip to content

Commit 0aaa665

Browse files
committed
issuu.com: fix plugin
1 parent fd6bcaa commit 0aaa665

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

plugins/domains/issuu.com.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
export default {
22

3-
re: /^https?:\/\/issuu\.com\/[\w_.-]+\/docs\/([\w_.-]+)/i,
3+
re: /^https?:\/\/issuu\.com\/([\w_.-]+)\/docs\/([\w_.-]+)/i,
44

5-
mixins: [
6-
"oembed-thumbnail",
7-
"oembed-author",
8-
"oembed-title",
9-
"oembed-site",
10-
"oembed-description",
11-
// "og-video",
12-
'domain-icon'
13-
],
5+
mixins: [ "*" ],
146

15-
getLink: function (oembed) {
7+
getLink: function (urlMatch) {
168

17-
if (!oembed.html) {
9+
if (!urlMatch || urlMatch.length < 3) {
1810
return;
1911
}
2012

21-
// let's make it responsive
22-
var html = oembed.html.replace (/style=\"[^\"]+\"/i, 'style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;"');
13+
const embedUrl = `https://e.issuu.com/embed.html?d=${encodeURIComponent(urlMatch[2])}&u=${encodeURIComponent(urlMatch[1])}`;
14+
15+
let html = `<iframe src="${embedUrl}" style="border:none;width:100%;height:100%;" allowfullscreen allow="fullscreen"></iframe>`;
16+
17+
html = html.replace(/style=\"[^\"]+\"/i, 'style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;"');
18+
2319
var aspect = 4/3;
2420
html = '<div style="left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: ' +
2521
Math.round(1000 * 100 / aspect) / 1000
@@ -36,6 +32,7 @@ export default {
3632

3733
tests: [
3834
"https://issuu.com/redbulletin.com/docs/the_red_bulletin_stratos_special_us",
35+
"https://issuu.com/cambridgenews/docs/cambridge_news_march_26_2026",
3936
"https://issuu.com/_dca/docs/edicio_n_diario_de_centro_ame_rica_02_de_junio_de_20",
4037
"https://issuu.com/visitfaroeislands/docs/tg25-uk-web_compressed",
4138
"https://issuu.com/cbmicheals/docs/wwii_hero_franklin_micheals",

0 commit comments

Comments
 (0)