1
+ /* eslint-disable no-undef */
2
+ 'use strict' ;
3
+
1
4
Prince . trackBoxes = true ;
2
5
3
6
const year = new Date ( ) . getFullYear ( ) ;
@@ -86,7 +89,11 @@ function rebuildLi(li) {
86
89
* Generates link elements for table of contents items
87
90
* */
88
91
function renderTocLink ( clauseID , clauseNumber , clauseTitle ) {
89
- const nonAnnexSections = [ 'sec-copyright-and-software-license' , 'sec-colophon' , 'sec-bibliography' ] ;
92
+ const nonAnnexSections = [
93
+ 'sec-copyright-and-software-license' ,
94
+ 'sec-colophon' ,
95
+ 'sec-bibliography' ,
96
+ ] ;
90
97
const link = document . createElement ( 'a' ) ;
91
98
link . setAttribute ( 'href' , '#' + clauseID ) ;
92
99
link . setAttribute ( 'title' , clauseTitle ) ;
@@ -99,7 +106,13 @@ function renderTocLink(clauseID, clauseNumber, clauseTitle) {
99
106
100
107
if ( / ^ [ A - Z ] $ / . test ( clauseNumber ) ) {
101
108
const annexType = document . getElementById ( clauseID ) . getAttribute ( 'normative' ) || 'informative' ;
102
- link . innerHTML = '<span class="secnum">Annex ' + clauseNumber + ' <span class="unbold">(' + annexType + ')</span></span> ' + clauseTitle ;
109
+ link . innerHTML =
110
+ '<span class="secnum">Annex ' +
111
+ clauseNumber +
112
+ ' <span class="unbold">(' +
113
+ annexType +
114
+ ')</span></span> ' +
115
+ clauseTitle ;
103
116
104
117
return link ;
105
118
}
@@ -117,10 +130,15 @@ function renderTocLink(clauseID, clauseNumber, clauseTitle) {
117
130
* Loops through every clause/annex's h1 and improves the markup
118
131
* */
119
132
function improveSectionHeadings ( ) {
133
+ // eslint-disable-next-line prettier/prettier
120
134
const sectionHeadings = Array . from ( specContainer . querySelectorAll ( 'emu-clause > h1, emu-annex > h1' ) ) ;
121
135
122
136
/** these section IDs are emu-annex elements but not functionally annexes */
123
- const nonAnnexSections = [ "sec-copyright-and-software-license" , 'sec-colophon' , 'sec-bibliography' ]
137
+ const nonAnnexSections = [
138
+ 'sec-copyright-and-software-license' ,
139
+ 'sec-colophon' ,
140
+ 'sec-bibliography' ,
141
+ ] ;
124
142
125
143
sectionHeadings . forEach ( h1 => {
126
144
const numElem = h1 . firstChild ;
@@ -135,7 +153,8 @@ function improveSectionHeadings() {
135
153
} else {
136
154
const annexType = parent . getAttribute ( 'normative' ) || 'informative' ;
137
155
138
- numElem . innerHTML = 'Annex ' + section + ' <br/><span class="unbold">(' + annexType + ')</span><br/>' ;
156
+ numElem . innerHTML =
157
+ 'Annex ' + section + ' <br/><span class="unbold">(' + annexType + ')</span><br/>' ;
139
158
}
140
159
} else {
141
160
numElem . textContent = section ;
@@ -217,7 +236,6 @@ function generateInsideCover() {
217
236
function generateEcmaCopyrightPage ( ) {
218
237
const copyrightNotice = document . createElement ( 'div' ) ;
219
238
220
-
221
239
copyrightNotice . classList . add ( 'copyright-notice' ) ;
222
240
copyrightNotice . innerHTML =
223
241
'<p>COPYRIGHT NOTICE</p>\n\n<p>© ' +
@@ -233,6 +251,7 @@ function generateEcmaCopyrightPage() {
233
251
function ecma262fixes ( ) {
234
252
const toc = document . getElementById ( 'toc' ) ;
235
253
254
+ // eslint-disable-next-line prettier/prettier
236
255
specContainer . insertBefore ( document . getElementById ( 'sec-bibliography' ) , document . getElementById ( 'sec-colophon' ) ) ;
237
256
Array . from ( toc . getElementsByTagName ( 'a' ) ) . forEach ( anchor => {
238
257
if ( anchor . getAttribute ( 'href' ) === '#sec-colophon' ) {
0 commit comments