diff --git a/astro.config.mjs b/astro.config.mjs index be732d8..f7399e2 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,15 +2,6 @@ import { defineConfig } from 'astro/config'; import tailwind from "@astrojs/tailwind"; import alpinejs from "@astrojs/alpinejs"; import { rehypeHeadingIds } from '@astrojs/markdown-remark'; -import rehypeAutolinkHeadings from "rehype-autolink-headings"; -import { toString } from 'hast-util-to-string' -import { h } from 'hastscript' - -const createSROnlyLabel = (text) => { - const node = h('span.sr-only', `Section: ${escape(text)}`) - node.properties['is:raw'] = true - return node -} // https://astro.build/config export default defineConfig({ @@ -18,26 +9,6 @@ export default defineConfig({ markdown: { rehypePlugins: [ rehypeHeadingIds, - [ - rehypeAutolinkHeadings, - { - behavior: 'append', - group: ({ tagName }) => - h(`div.heading-wrapper.level-${tagName}`, { - tabIndex: -1, - }), - content: (heading) => [ - h( - `span.anchor-icon`, - { - ariaHidden: 'true', - }, - '#' - ), - createSROnlyLabel(toString(heading)), - ], - } - ] ], } }); \ No newline at end of file diff --git a/package.json b/package.json index cddd441..0764288 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,6 @@ "alpinejs": "^3.0.0", "astro": "^3.3.2", "csv-parse": "^5.5.2", - "hast-util-to-string": "^3.0.0", - "hastscript": "^8.0.0", - "rehype-autolink-headings": "^7.0.0", "sass": "^1.69.4", "simple-datatables": "^8.0.0", "tailwindcss": "^3.0.24" diff --git a/src/styles/markdown.scss b/src/styles/markdown.scss index c513311..13d7fdd 100644 --- a/src/styles/markdown.scss +++ b/src/styles/markdown.scss @@ -5,23 +5,6 @@ * Copyright (c) 2021 Robert Guss. Used under the MIT License . */ .markdown-content { - h1, h2, h3, h4, h5, h6 { - a { - font-size: .85em; - margin-left: -0.5em; - padding-right: 0.23em; - margin-top: 0.125em; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - @apply opacity-0 no-underline float-left; - } - - a:hover { - @apply opacity-100 text-web-blue no-underline; - } - } - h1, h2, h3 { @apply underline; } diff --git a/yarn.lock b/yarn.lock index 340f400..111ab9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1556,20 +1556,6 @@ hast-util-from-parse5@^8.0.0: vfile-location "^5.0.0" web-namespaces "^2.0.0" -hast-util-heading-rank@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz#2d5c6f2807a7af5c45f74e623498dd6054d2aba8" - integrity sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA== - dependencies: - "@types/hast" "^3.0.0" - -hast-util-is-element@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz#6e31a6532c217e5b533848c7e52c9d9369ca0932" - integrity sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g== - dependencies: - "@types/hast" "^3.0.0" - hast-util-parse-selector@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz#25ab00ae9e75cbc62cf7a901f68a247eade659e2" @@ -1680,13 +1666,6 @@ hast-util-to-parse5@^8.0.0: web-namespaces "^2.0.0" zwitch "^2.0.0" -hast-util-to-string@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-3.0.0.tgz#2a131948b4b1b26461a2c8ac876e2c88d02946bd" - integrity sha512-OGkAxX1Ua3cbcW6EJ5pT/tslVb90uViVkcJ4ZZIMW/R33DX/AkcJcRrPebPwJkHYwlDHXz4aIwvAAaAdtrACFA== - dependencies: - "@types/hast" "^3.0.0" - hast-util-whitespace@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz#0ec64e257e6fc216c7d14c8a1b74d27d650b4557" @@ -2947,18 +2926,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -rehype-autolink-headings@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/rehype-autolink-headings/-/rehype-autolink-headings-7.0.0.tgz#bb98de219fa434ae41304631acabaed32497395f" - integrity sha512-DLskejGYHQP9v7vUW85BeYIclgfMQ1IwAMx+0lm8Sr3cME2NThgy2OdTfosmuBA68fqP5o4FK+dknpUMFvlxYQ== - dependencies: - "@types/hast" "^3.0.0" - "@ungap/structured-clone" "^1.0.0" - hast-util-heading-rank "^3.0.0" - hast-util-is-element "^3.0.0" - unified "^11.0.0" - unist-util-visit "^5.0.0" - rehype-parse@^8.0.0: version "8.0.5" resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-8.0.5.tgz#ccffc21e08e288c7846614f8dc1dc23d603a4a80" @@ -3524,19 +3491,6 @@ unified@^10.0.0, unified@^10.1.2: trough "^2.0.0" vfile "^5.0.0" -unified@^11.0.0: - version "11.0.3" - resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.3.tgz#e141be0fe466a2d28b2160f62712bc9cbc08fdd4" - integrity sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg== - dependencies: - "@types/unist" "^3.0.0" - bail "^2.0.0" - devlop "^1.0.0" - extend "^3.0.0" - is-plain-obj "^4.0.0" - trough "^2.0.0" - vfile "^6.0.0" - unist-util-generated@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-2.0.1.tgz#e37c50af35d3ed185ac6ceacb6ca0afb28a85cae"