diff options
author | NunoSempere <nuno.sempere@protonmail.com> | 2023-09-15 12:39:14 +0300 |
---|---|---|
committer | NunoSempere <nuno.sempere@protonmail.com> | 2023-09-15 12:40:27 +0300 |
commit | 2ce28303518c42cd17096145beecc1c89110429f (patch) | |
tree | 87809981095f32a4a09b8b1652793d9b5e382b0e /plugins/readability | |
parent | aaeb755c64e5e8158243e02523142ce7e185375c (diff) |
in readability, center images and add max-width.
Diffstat (limited to 'plugins/readability')
-rw-r--r-- | plugins/readability/readability.c | 2 | ||||
-rw-r--r-- | plugins/readability/readability.h | 2 | ||||
-rw-r--r-- | plugins/readability/readability.js | 22 |
3 files changed, 16 insertions, 10 deletions
diff --git a/plugins/readability/readability.c b/plugins/readability/readability.c index 327f212..894b9b4 100644 --- a/plugins/readability/readability.c +++ b/plugins/readability/readability.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#define READABILITY_N 85314 + 1000 +#define READABILITY_N 85433 + 1000 void read_readability_js(char* string) { diff --git a/plugins/readability/readability.h b/plugins/readability/readability.h index 4139213..a292e0a 100644 --- a/plugins/readability/readability.h +++ b/plugins/readability/readability.h @@ -1,7 +1,7 @@ #ifndef READABILITY #define READABILITY -#define READABILITY_N 85314 + 1000 +#define READABILITY_N 85433 + 1000 void read_readability_js(char* string); diff --git a/plugins/readability/readability.js b/plugins/readability/readability.js index 9310961..0a5bda7 100644 --- a/plugins/readability/readability.js +++ b/plugins/readability/readability.js @@ -2377,10 +2377,18 @@ document.body.innerHTML = `<h1>${article.title}</h1>\n${article.content}` /* Hack for archive.is */ -var styles +var styles = ` +img { + max-width: 80% !important; + height: auto; + display: block; + margin-left: auto; + margin-right: auto; +} +` if (document.domain == "archive.is" ){ - styles = ` + styles+= ` li > span { display: none !important; @@ -2400,9 +2408,7 @@ if (document.domain == "archive.is" ){ ` } -if(styles != null){ - var styleSheet = document.createElement('style') - styleSheet.innerText = styles - document.head.appendChild(styleSheet) - console.log('Style changed') -} +var styleSheet = document.createElement('style') +styleSheet.innerText = styles +document.head.appendChild(styleSheet) +console.log('Style changed') |