From 4f3d48c1d9088a7c4baf1023bf08add12982be26 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 3 Feb 2022 11:42:26 +0100 Subject: [PATCH] fix: fix formatting on code links (#316) --- .markdownlint.yml | 1 + exampleSite/content/en/features/code-blocks.md | 2 +- layouts/_default/_markup/render-link.html | 10 ++++++++-- src/sass/_markdown.scss | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.markdownlint.yml b/.markdownlint.yml index b59a114..1a62b25 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -2,5 +2,6 @@ default: True MD013: False MD041: False +MD042: False MD004: style: dash diff --git a/exampleSite/content/en/features/code-blocks.md b/exampleSite/content/en/features/code-blocks.md index 6ed21ca..03beb09 100644 --- a/exampleSite/content/en/features/code-blocks.md +++ b/exampleSite/content/en/features/code-blocks.md @@ -14,7 +14,7 @@ To display an inline shortcode use single quotes: `some code` ``` -**Example:** `some code` +**Example:** `some code` with a [`link`](#) ## Code blocks diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 2ce4b67..c319671 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,8 +1,14 @@ {{- $raw := or (hasPrefix .Text "{{ .Text | safeHTML }} + {{- .Text | safeHTML -}} + {{- /* Drop trailing newlines */ -}} diff --git a/src/sass/_markdown.scss b/src/sass/_markdown.scss index 4acbf21..becb5c4 100644 --- a/src/sass/_markdown.scss +++ b/src/sass/_markdown.scss @@ -69,6 +69,24 @@ } } + &__link--code { + text-decoration: none; + code { + color: inherit !important; + } + + &:hover { + background: none; + color: var(--link-color) !important; + text-decoration: underline; + } + + &:visited, + &:visited:hover { + color: var(--link-color-visited) !important; + } + } + &__figure { padding: $padding-4; margin: $padding-16 0;