marijnh / Eloquent-JavaScript

The sources for the Eloquent JavaScript book
https://eloquentjavascript.net
3.02k stars 796 forks source link

Table of Contents number (Firefox only?) #535

Closed karbassi closed 3 years ago

karbassi commented 3 years ago

I noticed that in Firefox only Values, Types, and Operators and Program Structure is numbered as 1.

FireFox

Screen Shot 2020-10-29 at 1 20 49 PM

Firefox 83.0b5 (64-bit) Mac OS 10.15.7

Chrome

Screen Shot 2020-10-29 at 1 20 48 PM

Chrome Version 87.0.4280.27 (Official Build) beta (x86_64) Mac OS 10.15.7

Thoughts

Looking at the HTML, it looks likes it looks like you don't need counter-reset: li.

https://github.com/marijnh/Eloquent-JavaScript/blob/7f07a68efedaf88f55ad8788070272fe312af3dc/html/index.html#L77

I don't know if it's needed in the epub.

https://github.com/marijnh/Eloquent-JavaScript/blob/7f07a68efedaf88f55ad8788070272fe312af3dc/epub/toc.xhtml.src#L45

marijnh commented 3 years ago

I just upgraded Firefox from 81 to 82—the problem didn't exist in 81, but does in 82. So I'm going to assume it's a newly introduced bug in the browser.

Removing the counter-reset indeed helps. I'm not sure why I put that there... possibly to work around misbehavior in another browser, but if so I'm just going to hope that that browser has become irrelevant in the meantime.