From a19a19190d862304763566a377e75eed95d37b69 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Fri, 5 Apr 2024 15:06:15 -0300 Subject: [PATCH] fix: resolve position and size issues with external link icons (#911) * chore(deps-dev): bump eslint-plugin-markdown to 4.0.1 * fix: resolve position and size issues with external link icons * fix: resolve linting issue * fix: don't add external link symbol to anchors (resolves #832) * fix: resolve linting issue --- .eslintrc.js | 2 +- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/_transforms/parse.js | 1 + src/assets/styles/base/_base.scss | 6 ++---- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 27f1660a..5a9e7326 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,7 +5,7 @@ module.exports = { "fluid", "plugin:yml/standard", "plugin:react/recommended", - "plugin:markdown/recommended" + "plugin:markdown/recommended-legacy" ], ignorePatterns: ["_site/", "src/_locales/messages.js", "!.*.cjs", "!.*.js", "!.github/"], env: { diff --git a/package-lock.json b/package-lock.json index ee331f0f..89a618dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "eslint": "8.57.0", "eslint-config-fluid": "2.1.1", "eslint-plugin-jsdoc": "48.2.3", - "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-markdown": "4.0.1", "eslint-plugin-react": "7.34.1", "eslint-plugin-yml": "1.14.0", "estrella": "1.4.1", @@ -8896,18 +8896,18 @@ } }, "node_modules/eslint-plugin-markdown": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-3.0.1.tgz", - "integrity": "sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-4.0.1.tgz", + "integrity": "sha512-5/MnGvYU0i8MbHH5cg8S+Vl3DL+bqRNYshk1xUO86DilNBaxtTkhH+5FD0/yO03AmlI6+lfNFdk2yOw72EPzpA==", "dev": true, "dependencies": { "mdast-util-from-markdown": "^0.8.5" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": ">=8" } }, "node_modules/eslint-plugin-react": { @@ -26645,9 +26645,9 @@ } }, "eslint-plugin-markdown": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-3.0.1.tgz", - "integrity": "sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-4.0.1.tgz", + "integrity": "sha512-5/MnGvYU0i8MbHH5cg8S+Vl3DL+bqRNYshk1xUO86DilNBaxtTkhH+5FD0/yO03AmlI6+lfNFdk2yOw72EPzpA==", "dev": true, "requires": { "mdast-util-from-markdown": "^0.8.5" diff --git a/package.json b/package.json index 72fcd85d..9bdf5a4c 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "eslint": "8.57.0", "eslint-config-fluid": "2.1.1", "eslint-plugin-jsdoc": "48.2.3", - "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-markdown": "4.0.1", "eslint-plugin-react": "7.34.1", "eslint-plugin-yml": "1.14.0", "estrella": "1.4.1", diff --git a/src/_transforms/parse.js b/src/_transforms/parse.js index 244c840e..fe6abe47 100644 --- a/src/_transforms/parse.js +++ b/src/_transforms/parse.js @@ -38,6 +38,7 @@ module.exports = (value, outputPath) => { if (links.length > 0) { for (const link of links) { if ( + link.href && !link.href.startsWith("/") && (!["localhost:3000", "localhost:8080", "idrc.ocadu.ca"].includes(link.host) || !link.host.endsWith("idrc.netlify.app")) ) { diff --git a/src/assets/styles/base/_base.scss b/src/assets/styles/base/_base.scss index 56bbb74d..a0126082 100755 --- a/src/assets/styles/base/_base.scss +++ b/src/assets/styles/base/_base.scss @@ -65,13 +65,11 @@ footer { a[hreflang], a[download], a[rel="external"] { - align-items: center; - display: inline-flex; - gap: 0.25em; - svg { display: inline-block; inline-size: 1em; + margin-block-end: 0.25em; + margin-inline: 0.25em 0.5ch; } }