diff --git a/components/Markdown.module.scss b/components/Markdown.module.scss index ce0b25c2079b44a56b243c1ad2e91bddbf8868c4..0154eff88158d3dc782f9cd41ac8c7adcae272ae 100644 --- a/components/Markdown.module.scss +++ b/components/Markdown.module.scss @@ -22,4 +22,12 @@ opacity: 0.5; margin-left: 24px; } + + a { + text-decoration: underline; + + &:hover { + opacity: 0.8; + } + } } diff --git a/components/Markdown.tsx b/components/Markdown.tsx index f4956f02455bc3b01f7d9fb43f2651f7bd3dafb2..a49743ca73be1d321efed621a319e6e22a2961be 100644 --- a/components/Markdown.tsx +++ b/components/Markdown.tsx @@ -1,7 +1,9 @@ import MarkdownIt from "markdown-it"; import styles from './Markdown.module.scss'; +import MarkdownItAnchor from "markdown-it-anchor"; -export const md: MarkdownIt = MarkdownIt({ breaks: true, linkify: true }); +export const md: MarkdownIt = MarkdownIt({ breaks: true, linkify: true }) + .use(MarkdownItAnchor, { level: 3 }); interface Props { content?: string; diff --git a/legal b/legal index 8cab30f62401102b501eef3c2f8c26230c611867..587d133232e7c739cffd449c4e011d0519a0a6c4 160000 --- a/legal +++ b/legal @@ -1 +1 @@ -Subproject commit 8cab30f62401102b501eef3c2f8c26230c611867 +Subproject commit 587d133232e7c739cffd449c4e011d0519a0a6c4 diff --git a/package.json b/package.json index 4df5d04a424be65df9952f9a3e85aa7db5798784..cb829b3e81affab84b52d0dd5cab30ce36fe6a08 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@types/react": "^17.0.3", "classnames": "^2.3.1", "markdown-it": "^12.0.6", + "markdown-it-anchor": "^7.1.0", "sass": "^1.32.10", "styled-components": "^5.2.3", "typescript": "^4.2.4" diff --git a/yarn.lock b/yarn.lock index abecc00b28f7269bf26030ed912e20ee3b81261f..3c0c2503dfcf39475fdf7f0d8c45c33950d04390 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1274,6 +1274,11 @@ make-dir@^3.0.2: dependencies: semver "^6.0.0" +markdown-it-anchor@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-7.1.0.tgz#30fb21497bf59e83ff4d1ddc052d821962e2489e" + integrity sha512-loQggrwsIkkP7TOrESvmYkV2ikbQNNKhHcWyqC7/C2CmfHl1tkUizJJU8C5aGgg7J6oXVQJx17gk7i47tNn/lQ== + markdown-it@^12.0.6: version "12.0.6" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.0.6.tgz#adcc8e5fe020af292ccbdf161fe84f1961516138"