fix: fix formatting on code links (#316)

This commit is contained in:
Robert Kaussow 2022-02-03 11:42:26 +01:00 committed by GitHub
parent 30d3c64c41
commit 4f3d48c1d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View file

@ -2,5 +2,6 @@
default: True
MD013: False
MD041: False
MD042: False
MD004:
style: dash

View file

@ -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

View file

@ -1,8 +1,14 @@
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
{{- $code := hasPrefix .Text "<code" -}}
<a
class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}"
class="gdoc-markdown__link{{ if $raw -}}
--raw
{{- else if $code -}}
--code
{{- end }}"
href="{{ .Destination | safeURL }}"
{{ with .Title }}title="{{ . }}"{{ end }}
>{{ .Text | safeHTML }}</a
>
{{- .Text | safeHTML -}}
</a>
{{- /* Drop trailing newlines */ -}}

View file

@ -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;