Skip to content

Commit efb9f13

Browse files
authored
fix: Apply various suggestions from @martinthomson (ietf-tools#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.
1 parent 83771ac commit efb9f13

4 files changed

Lines changed: 6 additions & 17 deletions

File tree

ietf/static/css/document_html.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ $tooltip-margin: inherit !default;
104104

105105
code {
106106
font-size: 1em;
107-
color: var(--bs-body-color);
107+
color: inherit;
108108
}
109109

110110
@media screen {

ietf/static/css/document_html_txt.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ blockquote {
7070
border-left: 2px solid darkgrey;
7171
}
7272

73+
// Don't wrap boilerplate URLs; makes it look more like text version.
74+
:is(#status-of-memo, #copyright) a[href] {
75+
white-space: nowrap;
76+
}
77+
7378
/* Header junk */
7479
#external-metadata {
7580
display: none !important; /* metadata.min.js is evil because it produces unstyleable goop */

ietf/static/js/document_html.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@ document.addEventListener("DOMContentLoaded", function (event) {
3838
});
3939
});
4040

41-
// Rewrite ids and hrefs to not contains dots (bug in bs5.2 scrollspy)
42-
// See https://github.com/twbs/bootstrap/issues/34381
43-
// TODO: check if this can be removed when bs5 is updated
44-
const ids = document.querySelectorAll(
45-
"#content [id^=section-], #content [id^=appendix-]");
46-
[...ids].map(id_el => id_el.id = id_el.id.replaceAll(/\./g, "-"));
47-
const hrefs = document.querySelectorAll(
48-
"#content [href*='#section-'], #content [href*='#appendix-']"
49-
);
50-
[...hrefs].map(id_el => {
51-
const href = new URL(id_el.href);
52-
href.hash = href.hash.replaceAll(/\./g, "-");
53-
id_el.href = href.href;
54-
});
55-
5641
// Set up a nav pane
5742
const toc_pane = document.getElementById("toc-nav");
5843
populate_nav(toc_pane,

ietf/static/js/nav.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export function populate_nav(nav, heading_selector, classes) {
8989
document.addEventListener("scroll", debounce(function () {
9090
const items = nav.querySelectorAll(".active");
9191
const item = [...items].pop();
92-
console.log(item);
9392
if (item) {
9493
item.scrollIntoView({
9594
block: "center",

0 commit comments

Comments
 (0)