Skip to content

Commit b7f7696

Browse files
committed
More markdwown rendering fixes and improvements
- Handle a very large table of contents better. - Fix handling from same-repo hrefs. - Improve table rendering.
1 parent aa79b70 commit b7f7696

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

markdown/index.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
border: 1px solid black;
3535
border-collapse: collapse;
3636
margin-bottom: 2ex;
37-
white-space: nowrap;
3837
}
3938

4039
#table-of-contents {
@@ -81,15 +80,21 @@
8180
margin-top: 1.5em;
8281
}
8382

84-
toc .sideitem {
83+
#toc .sideitem {
8584
padding: 0.5em 0.5em;
85+
margin-bottom: 0;
8686
}
8787

8888
#toc h2 {
8989
margin-bottom: 0.5em;
9090
padding-bottom: 0.0em;
9191
}
9292

93+
#toc #table-of-contents {
94+
max-height: 66vh;
95+
overflow-y: auto;
96+
}
97+
9398
/*]]>*/
9499
</style>
95100
</head>
@@ -158,7 +163,7 @@
158163
if (parts != null && parts.groups.path.endsWith('.md')) {
159164
tableOfContentsAside = `
160165
<div id="toc" class="col-md-6">
161-
<aside
166+
<aside>
162167
<ul class="ul-left-nav">
163168
<div class="sideitem">
164169
<h2>Table of Contents</h2>
@@ -285,6 +290,8 @@ <h2>Table of Contents</h2>
285290
const siteURL = toSiteURL(logicalHref);
286291
if (siteURL != null) {
287292
a.href = siteURL;
293+
} else if (!href.startsWith('http')) {
294+
a.href = new URL(`https://github.com/${org}/${repo}/blob/${branch}/${path}/../${href}`);
288295
}
289296
continue;
290297
}

0 commit comments

Comments
 (0)