Skip to content

Commit 0cf9b9a

Browse files
committed
Markup: Fix lint issues that don't interfere with Prince
1 parent 47d59b6 commit 0cf9b9a

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

js/print.js

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable no-undef */
2+
'use strict';
3+
14
Prince.trackBoxes = true;
25

36
const year = new Date().getFullYear();
@@ -86,7 +89,11 @@ function rebuildLi(li) {
8689
* Generates link elements for table of contents items
8790
* */
8891
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+
];
9097
const link = document.createElement('a');
9198
link.setAttribute('href', '#' + clauseID);
9299
link.setAttribute('title', clauseTitle);
@@ -99,7 +106,13 @@ function renderTocLink(clauseID, clauseNumber, clauseTitle) {
99106

100107
if (/^[A-Z]$/.test(clauseNumber)) {
101108
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;
103116

104117
return link;
105118
}
@@ -117,10 +130,15 @@ function renderTocLink(clauseID, clauseNumber, clauseTitle) {
117130
* Loops through every clause/annex's h1 and improves the markup
118131
* */
119132
function improveSectionHeadings() {
133+
// eslint-disable-next-line prettier/prettier
120134
const sectionHeadings = Array.from(specContainer.querySelectorAll('emu-clause > h1, emu-annex > h1'));
121135

122136
/** 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+
];
124142

125143
sectionHeadings.forEach(h1 => {
126144
const numElem = h1.firstChild;
@@ -135,7 +153,8 @@ function improveSectionHeadings() {
135153
} else {
136154
const annexType = parent.getAttribute('normative') || 'informative';
137155

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/>';
139158
}
140159
} else {
141160
numElem.textContent = section;
@@ -217,7 +236,6 @@ function generateInsideCover() {
217236
function generateEcmaCopyrightPage() {
218237
const copyrightNotice = document.createElement('div');
219238

220-
221239
copyrightNotice.classList.add('copyright-notice');
222240
copyrightNotice.innerHTML =
223241
'<p>COPYRIGHT NOTICE</p>\n\n<p>© ' +
@@ -233,6 +251,7 @@ function generateEcmaCopyrightPage() {
233251
function ecma262fixes() {
234252
const toc = document.getElementById('toc');
235253

254+
// eslint-disable-next-line prettier/prettier
236255
specContainer.insertBefore(document.getElementById('sec-bibliography'), document.getElementById('sec-colophon'));
237256
Array.from(toc.getElementsByTagName('a')).forEach(anchor => {
238257
if (anchor.getAttribute('href') === '#sec-colophon') {

src/Spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,8 @@ ${await utils.readFile(path.join(__dirname, '../js/multipage.js'))}
11731173
this.doc.head,
11741174
`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/${
11751175
(hljs as any).versionString
1176-
}/styles/base16/solarized-light.min.css`);
1176+
}/styles/base16/solarized-light.min.css`,
1177+
);
11771178
}
11781179

11791180
private addStyle(head: HTMLHeadElement, href: string, media?: 'all' | 'print' | 'screen') {

0 commit comments

Comments
 (0)