fix: Apply various suggestions from @martinthomson (#4849)
* With bs 5.2.3, no need to rewrite dots in ids and hrefs. * Remove leftover console.log(). * Inherit color for <code> * Don't wrap boilerplate URLs; makes it look more like text version.
This commit is contained in:
parent
83771aceb3
commit
efb9f135c3
|
@ -104,7 +104,7 @@ $tooltip-margin: inherit !default;
|
|||
|
||||
code {
|
||||
font-size: 1em;
|
||||
color: var(--bs-body-color);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
@media screen {
|
||||
|
|
|
@ -70,6 +70,11 @@ blockquote {
|
|||
border-left: 2px solid darkgrey;
|
||||
}
|
||||
|
||||
// Don't wrap boilerplate URLs; makes it look more like text version.
|
||||
:is(#status-of-memo, #copyright) a[href] {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Header junk */
|
||||
#external-metadata {
|
||||
display: none !important; /* metadata.min.js is evil because it produces unstyleable goop */
|
||||
|
|
|
@ -38,21 +38,6 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
|||
});
|
||||
});
|
||||
|
||||
// Rewrite ids and hrefs to not contains dots (bug in bs5.2 scrollspy)
|
||||
// See https://github.com/twbs/bootstrap/issues/34381
|
||||
// TODO: check if this can be removed when bs5 is updated
|
||||
const ids = document.querySelectorAll(
|
||||
"#content [id^=section-], #content [id^=appendix-]");
|
||||
[...ids].map(id_el => id_el.id = id_el.id.replaceAll(/\./g, "-"));
|
||||
const hrefs = document.querySelectorAll(
|
||||
"#content [href*='#section-'], #content [href*='#appendix-']"
|
||||
);
|
||||
[...hrefs].map(id_el => {
|
||||
const href = new URL(id_el.href);
|
||||
href.hash = href.hash.replaceAll(/\./g, "-");
|
||||
id_el.href = href.href;
|
||||
});
|
||||
|
||||
// Set up a nav pane
|
||||
const toc_pane = document.getElementById("toc-nav");
|
||||
populate_nav(toc_pane,
|
||||
|
|
|
@ -89,7 +89,6 @@ export function populate_nav(nav, heading_selector, classes) {
|
|||
document.addEventListener("scroll", debounce(function () {
|
||||
const items = nav.querySelectorAll(".active");
|
||||
const item = [...items].pop();
|
||||
console.log(item);
|
||||
if (item) {
|
||||
item.scrollIntoView({
|
||||
block: "center",
|
||||
|
|
Loading…
Reference in a new issue