fix(feeds.js): preserve content of inactive (href='#') links rather than remove them altogether

This commit is contained in:
Cory Dransfeldt 2025-05-13 04:41:15 -07:00
parent 2f52ee2253
commit f7f9596dd1
No known key found for this signature in database
3 changed files with 9 additions and 7 deletions

View file

@ -11,7 +11,9 @@ export default {
let href = link.getAttribute("href"); let href = link.getAttribute("href");
if (href.startsWith("#")) { if (href.startsWith("#")) {
link.remove(); const span = document.createElement("span");
span.textContent = link.textContent;
link.replaceWith(span);
return; return;
} }

10
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "4.1.7", "version": "4.1.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "4.1.7", "version": "4.1.8",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"html-minifier-terser": "7.2.0", "html-minifier-terser": "7.2.0",
@ -1032,9 +1032,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001717", "version": "1.0.30001718",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz",
"integrity": "sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==", "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "4.1.7", "version": "4.1.8",
"description": "The source for my personal site. Built using 11ty (and other tools).", "description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module", "type": "module",
"engines": { "engines": {