From 00e3b966ee351210976c521a85b8bb27f69aa3c4 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Sun, 19 Jul 2026 20:23:52 +0200 Subject: [PATCH 1/2] fix(core): tighten Freedium download-button cleanup Replace the broad previousElementSibling/HEADER removal with a precise selector that matches only the .flex.justify-end wrapper containing the 'Download article' button. The old heuristic was removing article headers on NYT/WaPo captures. --- crates/archivr-core/src/downloader/singlefile.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/archivr-core/src/downloader/singlefile.rs b/crates/archivr-core/src/downloader/singlefile.rs index dd21e4a..1dce2b2 100644 --- a/crates/archivr-core/src/downloader/singlefile.rs +++ b/crates/archivr-core/src/downloader/singlefile.rs @@ -540,12 +540,12 @@ fn save_with( document.querySelectorAll('[data-nosnippet]').forEach(function(el){\ if(!el.firstElementChild&&!el.textContent.trim())el.remove();\ });\ - document.querySelectorAll('[data-slot=\"dropdown-menu-trigger\"]').forEach(function(btn){\ - if(!/download/i.test(btn.textContent||''))return;\ - var sec=btn.closest('section');if(!sec)return;\ - var prev=sec.previousElementSibling;\ - if(prev&&prev.tagName==='HEADER')prev.remove();\ - sec.remove();\ + document.querySelectorAll('section>.flex.justify-end>button[data-slot=\"dropdown-menu-trigger\"][type=\"button\"].flex.items-center>span').forEach(function(span){\ + if(span.textContent.trim()!=='Download article')return;\ + var wrap=span.closest('.flex.justify-end');\ + var sec=wrap.closest('section');\ + wrap.remove();\ + if(sec&&sec.children.length===0)sec.remove();\ });", ); } From 14fd091d1f4c7f5512eecc23ccf2719befc2cb9c Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Sun, 19 Jul 2026 20:47:11 +0200 Subject: [PATCH 2/2] fix(core): tighten reader-mode typography and spacing - h1: explicit font-size:2em, font-weight:700, line-height:1.2 - byline: margin:.3em top, font-size:15px, line-height:1.5 - siteName: margin:.3em top, font-size:13px - add p{margin:0 0 1.15em} for consistent paragraph spacing - add figcaption rule: 14px italic gray with .5em top margin - bump figure/img margin to 1.5em, blockquote margin to 1.2em --- crates/archivr-core/src/downloader/singlefile.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/archivr-core/src/downloader/singlefile.rs b/crates/archivr-core/src/downloader/singlefile.rs index 1dce2b2..4fbc1bd 100644 --- a/crates/archivr-core/src/downloader/singlefile.rs +++ b/crates/archivr-core/src/downloader/singlefile.rs @@ -108,13 +108,13 @@ const READER_MODE_SCRIPT: &str = concat!( if (article.title) document.title = article.title; var hdr = document.createElement('header'); hdr.innerHTML = - '

' + + '

' + (article.title || '') + '

' + (article.byline - ? '

' + article.byline + '

' + ? '

' + article.byline + '

' : '') + (article.siteName - ? '

' + article.siteName + '

' + ? '

' + article.siteName + '

' : ''); hdr.style.cssText = 'margin-bottom:2em;padding-bottom:1em;border-bottom:1px solid #ddd'; document.body.insertBefore(hdr, document.body.firstChild); @@ -124,12 +124,14 @@ const READER_MODE_SCRIPT: &str = concat!( 'font-family:Georgia,"Times New Roman",serif;font-size:18px;', 'line-height:1.75;color:#1a1a1a;background:#fafaf8}', 'h1,h2,h3,h4,h5,h6{font-family:-apple-system,BlinkMacSystemFont,sans-serif;', - 'line-height:1.3;margin-top:1.5em}', - 'img,figure,video{max-width:100%;height:auto;display:block;margin:1em 0}', + 'line-height:1.3;margin-top:1.6em}', + 'p{margin:0 0 1.15em}', + 'img,figure,video{max-width:100%;height:auto;display:block;margin:1.5em 0}', + 'figcaption{font-size:14px;color:#666;margin:.5em 0 0;font-style:italic;line-height:1.5}', 'a{color:#0055cc}', 'pre{background:#f4f4f4;padding:1em;border-radius:4px;overflow-x:auto;font-size:14px}', 'code{background:#f4f4f4;padding:.1em .3em;border-radius:3px;font-size:14px}', - 'blockquote{border-left:3px solid #ccc;margin:1em 0;padding-left:1.2em;color:#555}', + 'blockquote{border-left:3px solid #ccc;margin:1.2em 0;padding-left:1.2em;color:#555}', ].join(''); document.head.appendChild(style); _archivrReaderMark('applied');