Fix header links not working due to mismatching id
This commit is contained in:
parent
6122190ef8
commit
e9ba6f5787
|
@ -15,8 +15,13 @@ module.exports = config => {
|
|||
html: true
|
||||
};
|
||||
|
||||
let headingOptions = {
|
||||
prefixHeadingIds: false,
|
||||
className: "heading-anchor"
|
||||
};
|
||||
|
||||
config.setLibrary("md",
|
||||
markdownIt(options).use(markdownItScrollable).use(markdownItHeadings));
|
||||
markdownIt(options).use(markdownItScrollable).use(markdownItHeadings, headingOptions));
|
||||
|
||||
const paths = [
|
||||
'main/assets',
|
||||
|
|
|
@ -40,11 +40,11 @@ div.contents a::before {
|
|||
margin-right: 0em;
|
||||
}
|
||||
|
||||
a[id*="user-content-"]::before {
|
||||
a[class="heading-anchor"]::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a[id*="user-content-"] svg {
|
||||
a[class="heading-anchor"] svg {
|
||||
fill: #e5adea;
|
||||
margin-right: 5px;
|
||||
margin-left: -21px;
|
||||
|
@ -52,7 +52,7 @@ a[id*="user-content-"] svg {
|
|||
transition: opacity 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
:is(h1, h2, h3, h4, h5, h6):hover a[id*="user-content-"] svg {
|
||||
:is(h1, h2, h3, h4, h5, h6):hover a[class="heading-anchor"] svg {
|
||||
opacity: 80%;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
}
|
||||
|
@ -264,8 +264,8 @@ pre > code:not([class]) {
|
|||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
a[id*="user-content-"] {
|
||||
margin-left: 0;
|
||||
a[class="heading-anchor"] {
|
||||
margin-left: 21px;
|
||||
float: right;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue