ecmarkup
ecmarkup copied to clipboard
do something about the size of the table of contents
In ecma262, the table of contents is 400kb of HTML to represent 76kb of text plus a little structure. We can cut that down.
A lot of the overhead is that every link includes a title attribute which effectively duplicates its contents. That's almost certainly not worth the cost (if not actively harmful).
Another big chunk is the inclusion of classes on many elements which could be matched by broader selectors. For example, all the section numbers in the ToC have <span class="secnum">
, which, a) #menu-toc a > span
matches exactly those elements, so they don't need to have classes added manually and b) that class doesn't even do anything in this context. That's 30kb by itself.