From abd400830c4cd6e6d6c2d206105716b15db93fd2 Mon Sep 17 00:00:00 2001 From: Paul <paulmakles@gmail.com> Date: Tue, 20 Apr 2021 21:33:33 +0100 Subject: [PATCH] Update Markdown. --- components/Markdown.module.scss | 8 ++++++++ components/Markdown.tsx | 4 +++- legal | 2 +- package.json | 1 + yarn.lock | 5 +++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/components/Markdown.module.scss b/components/Markdown.module.scss index ce0b25c..0154eff 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 f4956f0..a49743c 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 8cab30f..587d133 160000 --- a/legal +++ b/legal @@ -1 +1 @@ -Subproject commit 8cab30f62401102b501eef3c2f8c26230c611867 +Subproject commit 587d133232e7c739cffd449c4e011d0519a0a6c4 diff --git a/package.json b/package.json index 4df5d04..cb829b3 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 abecc00..3c0c250 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" -- GitLab