Skip to content

Commit 548fa84

Browse files
authored
Merge pull request #22 from szymon-rd/misc-scaladoc-fixes
Misc scaladoc fixes
2 parents 94988e4 + c716047 commit 548fa84

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function attachAllListeners() {
5353
if (href === "") { return }
5454
const url = new URL(href)
5555
el.addEventListener('click', e => {
56-
if (url.href.replace("#", "") === window.location.href.replace("#", "")) { return }
56+
if (url.href.replace(/#.*/, "") === window.location.href.replace(/#.*/, "")) { return }
5757
if (url.origin !== window.location.origin) { return }
5858
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) { return }
5959
e.preventDefault()
@@ -188,6 +188,7 @@ document.getElementById("mobile-menu-close").addEventListener('click', _e => {
188188
})
189189

190190
window.addEventListener('popstate', e => {
191+
if (e.state === null) { return }
191192
const { leftColumn, mainDiv, title } = e.state
192193
document.title = title
193194
const { children } = document.body.firstChild
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
#content > div {
2-
width: 100%;
3-
}

scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SectionRenderingExtension.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ object SectionRenderingExtension extends HtmlRenderer.HtmlRendererExtension:
2727
val attributes = Attributes()
2828
val headerClass: String = header.getLevel match
2929
case 1 => "h500"
30-
case 2 => "h300"
31-
case 3 => "h200"
32-
case 4 => "h100"
30+
case 2 => "h500"
31+
case 3 => "h400"
32+
case 4 => "h300"
3333
case _ => "h50"
3434
attributes.addValue(AttributeImpl.of("class", headerClass))
3535
val embeddedAttributes = EmbeddedAttributeProvider.EmbeddedNodeAttributes(header, attributes)

0 commit comments

Comments
 (0)