From 22162140b74e71fd9854a73671f5daf08c46f3b9 Mon Sep 17 00:00:00 2001 From: heyalexhsu <1455442+heyalexhsu@users.noreply.github.com> Date: Wed, 8 Apr 2026 15:30:11 +0800 Subject: [PATCH 1/5] Add text-autospace to article view for proper CJK rendering. --- Shared/Article Rendering/stylesheet.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Shared/Article Rendering/stylesheet.css b/Shared/Article Rendering/stylesheet.css index 486deff3f..d0b3a76b9 100644 --- a/Shared/Article Rendering/stylesheet.css +++ b/Shared/Article Rendering/stylesheet.css @@ -154,6 +154,10 @@ body > .systemMessage { letter-spacing: 0em; } +.articleTitle, .articleDateline, .articleDatelineTitle, .articleBody { + text-autospace: normal; +} + .articleBody { margin-top: 20px; line-height: 1.6em; From f28d204c12f539732fe26e48e1ae3617a21eea3c Mon Sep 17 00:00:00 2001 From: Dave Marquard Date: Thu, 9 Jul 2026 15:54:50 -0700 Subject: [PATCH 2/5] Support Substack-style footnotes in the article popover Substack footnote references are bare anchors (not wrapped in like Multimarkdown), and their targets are backlink anchors whose note text lives in the following sibling elements rather than inside the target itself. Neither the footnote badge styling nor the newsfoot popover recognized them. - main.js: broaden styleLocalFootnotes() to also badge these bare anchors, and let isLocalFootnote() accept the "#footnote-" hash prefix (it previously only matched "#fn"). - newsfoot.js: add a Substack footnote format that recognizes the reference and extracts note content from the sibling elements after the backlink; the click handler now uses each format's own content extractor instead of assuming the target's innerHTML. Co-Authored-By: Claude Opus 4.8 --- Shared/Article Rendering/main.js | 6 ++-- Shared/Article Rendering/newsfoot.js | 41 ++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Shared/Article Rendering/main.js b/Shared/Article Rendering/main.js index 1856d2e14..2dc4601c6 100644 --- a/Shared/Article Rendering/main.js +++ b/Shared/Article Rendering/main.js @@ -167,11 +167,13 @@ function error() { // Takes into account absoluting of URLs. function isLocalFootnote(target) { - return target.hash.startsWith("#fn") && target.href.indexOf(document.baseURI) === 0; + return (target.hash.startsWith("#fn") || target.hash.startsWith("#footnote")) && target.href.indexOf(document.baseURI) === 0; } function styleLocalFootnotes() { - for (elem of document.querySelectorAll("sup > a[href*='#fn'], sup > div > a[href*='#fn']")) { + // Multimarkdown-style: . Substack-style: a bare + // with no wrapper. + for (elem of document.querySelectorAll("sup > a[href*='#fn'], sup > div > a[href*='#fn'], a[id^='footnote-anchor-']")) { if (isLocalFootnote(elem)) { elem.classList.add("footnote"); } diff --git a/Shared/Article Rendering/newsfoot.js b/Shared/Article Rendering/newsfoot.js index 9f1dae3f6..765c06bd0 100644 --- a/Shared/Article Rendering/newsfoot.js +++ b/Shared/Article Rendering/newsfoot.js @@ -125,12 +125,37 @@ if (!target.hash) return; return decodeURIComponent(target.hash.substring(1)); } - /** @type {{fnref(target:HTMLAnchorElement): string|undefined}[]} */ + /** + * @type {{ + * fnref(target:HTMLAnchorElement): string|undefined, + * content(targetElement:HTMLElement): string + * }[]} + */ const footnoteFormats = [ + { // Substack: the ref + // points at a backlink N whose note text lives + // in the sibling elements that follow it, not inside the anchor. + fnref(target) { + if (!target.matches("a[id^='footnote-anchor-']")) return; + return idFromHash(target); + }, + content(targetElement) { + let html = ""; + let node = targetElement.nextElementSibling; + while (node && !node.matches("a[id^='footnote-']")) { + html += node.outerHTML; + node = node.nextElementSibling; + } + return html; + } + }, { // Multimarkdown fnref(target) { if (!target.matches(".footnote")) return; return idFromHash(target); + }, + content(targetElement) { + return targetElement.innerHTML; } } ]; @@ -140,22 +165,26 @@ if (!(ev.target && ev.target instanceof HTMLAnchorElement)) return; let targetId = undefined; + let format = undefined; for(const f of footnoteFormats) { targetId = f.fnref(ev.target); - if (targetId) break; + if (targetId) { + format = f; + break; + } } if (targetId === undefined) return; - + // Only override the default behaviour when we know we can find the // target element const targetElement = document.getElementById(targetId); if (targetElement === null) return; - + ev.preventDefault(); installContainer(ev.target); - - void new Footnote(targetElement.innerHTML, ev.target); + + void new Footnote(format.content(targetElement), ev.target); }); // Handle clicks on the footnote reverse link From 1da8eb5949ed1e75f7c1c87f28b50331e795a200 Mon Sep 17 00:00:00 2001 From: Justin Reeves Date: Sun, 27 Sep 2026 22:38:15 -0500 Subject: [PATCH 3/5] Add `overflow-x: auto` to WordPress Math blocks and, conservatively, to SVG wrappers. #4059 --- Themes/Tiqoe Dark.nnwtheme/stylesheet.css | 146 ++++++++++++---------- 1 file changed, 78 insertions(+), 68 deletions(-) diff --git a/Themes/Tiqoe Dark.nnwtheme/stylesheet.css b/Themes/Tiqoe Dark.nnwtheme/stylesheet.css index 92f73e426..8c44be67a 100644 --- a/Themes/Tiqoe Dark.nnwtheme/stylesheet.css +++ b/Themes/Tiqoe Dark.nnwtheme/stylesheet.css @@ -3,7 +3,7 @@ body { margin-left: auto; margin-right: auto; - word-wrap: break-word; + overflow-wrap: break-word; max-width: 44em; background-color: #17120f; color: #c5c2c1; @@ -16,7 +16,14 @@ body { text-underline-offset: 0.15em; } -[href]:has(img):hover { +a[href]:hover, +.headerContainer a[href]:hover { + text-shadow: 0 1px rgba(0, 0, 0, 2); + opacity: 0.8; + color: color-mix(in hsl, var(--link-underline-color), firebrick 70%); +} + +a[href]:has(img):hover { opacity: 1; } @@ -180,11 +187,8 @@ pre { margin: 0; overflow: auto; overflow-y: hidden; - word-wrap: normal; + overflow-wrap: normal; word-break: normal; -} - -pre { line-height: 1.4286em; } @@ -377,14 +381,22 @@ a.footnote:hover, margin-bottom: 20px; padding-left: 20px; padding-right: 20px; - + font-family: Charter, Georgia, sans-serif; word-break: break-word; -webkit-hyphens: auto; -webkit-text-size-adjust: none; - font-family: Charter, Georgia, sans-serif; font-size: calc([[font-size]]px + 2px); } + figcaption { + font-size: calc([[font-size]]px + 0px); + } + + code, + pre { + font-size: calc([[font-size]]px - 2px); + } + .articleTitle h1 { font-size: 1.5em; } @@ -398,14 +410,6 @@ a.footnote:hover, border: 1px solid var(--secondary-accent-color); } - code, - pre { - font-size: calc([[font-size]]px - 2px); - } - - figcaption { - font-size: calc([[font-size]]px + 0px); - } } /* macOS Specific */ @@ -420,67 +424,67 @@ a.footnote:hover, .smallText { font-size: 14px; + + figcaption { + font-size: 12px; + } + + code, + pre { + font-size: 10px; + } } - - .smallText code, - .smallText pre { - font-size: 10px; - } - - .smallText figcaption { - font-size: 12px; - } - + .mediumText { font-size: 16px; + + figcaption { + font-size: 14px; + } + + code, + pre { + font-size: 12px; + } } - - .mediumText code, - .mediumText pre { - font-size: 12px; - } - - .mediumText figcaption { - font-size: 14px; - } - + .largeText { font-size: 18px; - } - - .largeText code, - .largeText pre { - font-size: 14px; - } - - .largeText figcaption { - font-size: 16px; + + figcaption { + font-size: 16px; + } + + code, + pre { + font-size: 14px; + } } .xlargeText { font-size: 20px; - } - - .xlargeText code, - .xlargeText pre { - font-size: 16px; - } - - .xlargeText figcaption { - font-size: 18px; + + figcaption { + font-size: 18px; + } + + code, + pre { + font-size: 16px; + } } .xxlargeText { font-size: 22px; - } - - .xxlargeText code, - .xxlargeText pre { - font-size: 18px; - } - - .xxlargeText figcaption { - font-size: 20px; + + figcaption { + font-size: 20px; + } + + code, + pre { + font-size: 18px; + } } pre { @@ -493,6 +497,7 @@ a.footnote:hover, } } +/* Substack */ .image-link-expand .icon-container svg { stroke: #aaa; } @@ -503,9 +508,14 @@ a.footnote:hover, stroke: color-mix(in hsl, var(--link-underline-color), firebrick 70%) } -[href]:hover, -.headerContainer a[href]:hover { - text-shadow: 0 1px rgba(0, 0, 0, 2); - opacity: 0.8; - color: color-mix(in hsl, var(--link-underline-color), firebrick 70%); +/* WordPress */ +.wp-block-math:has(> math[display="block"]) { + overflow-x: auto; + border: 1px solid var(--secondary-accent-color); + padding: 10px; +} + +/* SVG */ +:is(div, figure):has(> svg:only-child) { + overflow-x: auto; } From 558a7cac9b30264c398923ba66553f4474f56257 Mon Sep 17 00:00:00 2001 From: Justin Reeves Date: Tue, 29 Sep 2026 19:15:24 -0500 Subject: [PATCH 4/5] Hide PBS Newshour funding invite in Reader View --- Themes/Tiqoe Dark.nnwtheme/stylesheet.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Themes/Tiqoe Dark.nnwtheme/stylesheet.css b/Themes/Tiqoe Dark.nnwtheme/stylesheet.css index 8c44be67a..fb2960400 100644 --- a/Themes/Tiqoe Dark.nnwtheme/stylesheet.css +++ b/Themes/Tiqoe Dark.nnwtheme/stylesheet.css @@ -519,3 +519,8 @@ a.footnote:hover, :is(div, figure):has(> svg:only-child) { overflow-x: auto; } + +/* PBS Newshour → Reader View */ +.inline-invite.inline-invite-type__funding.inline-invite-style__default:has(> .inline-invite-funding__box):has([href*="give.newshour.org"]) { + display: none; +} From 34e4d06833d3c9e2671f849788cda091ae813031 Mon Sep 17 00:00:00 2001 From: Justin Reeves Date: Tue, 29 Sep 2026 19:23:30 -0500 Subject: [PATCH 5/5] Fix typo in PBS News Hour comment --- Themes/Tiqoe Dark.nnwtheme/stylesheet.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/Tiqoe Dark.nnwtheme/stylesheet.css b/Themes/Tiqoe Dark.nnwtheme/stylesheet.css index fb2960400..bbfa2634f 100644 --- a/Themes/Tiqoe Dark.nnwtheme/stylesheet.css +++ b/Themes/Tiqoe Dark.nnwtheme/stylesheet.css @@ -520,7 +520,7 @@ a.footnote:hover, overflow-x: auto; } -/* PBS Newshour → Reader View */ +/* PBS News Hour → Reader View */ .inline-invite.inline-invite-type__funding.inline-invite-style__default:has(> .inline-invite-funding__box):has([href*="give.newshour.org"]) { display: none; }