From 5bef6058b76cd454854010d02ad68c184e3929fe Mon Sep 17 00:00:00 2001 From: Phantop Date: Mon, 2 Sep 2024 12:30:31 -0400 Subject: [PATCH] qute: fix discord member bg, more miniflux header anchors --- qutebrowser/css/user.scss | 1 + qutebrowser/greasemonkey/miniflux.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/qutebrowser/css/user.scss b/qutebrowser/css/user.scss index 31329bf..43b81fa 100644 --- a/qutebrowser/css/user.scss +++ b/qutebrowser/css/user.scss @@ -7,6 +7,7 @@ #app-mount { //discord --background-primary: var(--bg_hover); --bg-overlay-2: var(--background-primary); + --bg-overlay-chat: var(--background-primary); --background-tertiary: var(--background-primary); --background-secondary: var(--background-primary); --background-secondary-alt: var(--background-primary); diff --git a/qutebrowser/greasemonkey/miniflux.js b/qutebrowser/greasemonkey/miniflux.js index bc98edb..8973777 100644 --- a/qutebrowser/greasemonkey/miniflux.js +++ b/qutebrowser/greasemonkey/miniflux.js @@ -13,7 +13,15 @@ for ($element of $elements) { // Check if heading has any nested elements with id var $innerElement = $element.querySelector('[id]'); if ($innerElement) { id = $innerElement.id; } - else { continue; } + else { + id = $element.tagName + '-' + $element.textContent + .replace(/\s+/g, '-') // Replace spaces with hyphens + .replace(/[^\w-]/g, '') // Remove non-word chars (except hyphens) + .replace(/--+/g, '-') // Replace multiple hyphens with single hyphen + .replace(/^-+/, '') // Trim hyphens from start + .replace(/-+$/, ''); // Trim hyphens from end + $element.id = id; + } } // Create anchor if not already present