docs: fix anchor links (#1845)
This commit is contained in:
@@ -43,6 +43,22 @@ ol.nested li:before {
|
||||
list-style: numeric;
|
||||
}
|
||||
|
||||
.markdown-body .md-anchor {
|
||||
color: inherit;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.markdown-body .md-anchor span {
|
||||
color: var(--color-accent-fg);
|
||||
display: inline-block;
|
||||
margin-left: .25rem;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.markdown-body .md-anchor:hover span {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.markdown-body .highlight {
|
||||
border: 1px solid #eaeef1;
|
||||
border-radius: .5rem;
|
||||
|
||||
@@ -38,7 +38,7 @@ class DefaultRenderer extends Marked.Renderer {
|
||||
slugger: Marked.Slugger,
|
||||
): string {
|
||||
const slug = slugger.slug(raw);
|
||||
return `<h${level} id="${slug}"><a class="anchor" aria-hidden="true" tabindex="-1" href="#${slug}">#</a>${text}</h${level}>`;
|
||||
return `<h${level} id="${slug}"><a class="md-anchor" tabindex="-1" href="#${slug}">${text}<span aria-hidden="true">#</span></a></h${level}>`;
|
||||
}
|
||||
|
||||
link(href: string, title: string | null, text: string) {
|
||||
|
||||
Reference in New Issue
Block a user