From 03215d3df5692d5b349527c38abbb29332d4aff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aki=20=F0=9F=8C=B9?= Date: Thu, 13 Jun 2024 18:11:06 -0700 Subject: [PATCH] Markup: Fix lint issuse that don't interfere with Prince --- js/print.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/js/print.js b/js/print.js index d3eb9e13..20cf69f4 100644 --- a/js/print.js +++ b/js/print.js @@ -1,3 +1,6 @@ +/* eslint-disable no-undef */ +'use strict'; + Prince.trackBoxes = true; const year = new Date().getFullYear(); @@ -86,7 +89,11 @@ function rebuildLi(li) { * Generates link elements for table of contents items * */ function renderTocLink(clauseID, clauseNumber, clauseTitle) { - const nonAnnexSections = ['sec-copyright-and-software-license', 'sec-colophon', 'sec-bibliography']; + const nonAnnexSections = [ + 'sec-copyright-and-software-license', + 'sec-colophon', + 'sec-bibliography', + ]; const link = document.createElement('a'); link.setAttribute('href', '#' + clauseID); link.setAttribute('title', clauseTitle); @@ -99,7 +106,13 @@ function renderTocLink(clauseID, clauseNumber, clauseTitle) { if (/^[A-Z]$/.test(clauseNumber)) { const annexType = document.getElementById(clauseID).getAttribute('normative') || 'informative'; - link.innerHTML = 'Annex ' + clauseNumber + ' (' + annexType + ') ' + clauseTitle; + link.innerHTML = + 'Annex ' + + clauseNumber + + ' (' + + annexType + + ') ' + + clauseTitle; return link; } @@ -117,10 +130,16 @@ function renderTocLink(clauseID, clauseNumber, clauseTitle) { * Loops through every clause/annex's h1 and improves the markup * */ function improveSectionHeadings() { - const sectionHeadings = Array.from(specContainer.querySelectorAll('emu-clause > h1, emu-annex > h1')); + const sectionHeadings = Array.from( + specContainer.querySelectorAll('emu-clause > h1, emu-annex > h1'), + ); /** these section IDs are emu-annex elements but not functionally annexes */ - const nonAnnexSections = ["sec-copyright-and-software-license", 'sec-colophon', 'sec-bibliography'] + const nonAnnexSections = [ + 'sec-copyright-and-software-license', + 'sec-colophon', + 'sec-bibliography', + ]; sectionHeadings.forEach(h1 => { const numElem = h1.firstChild; @@ -135,7 +154,8 @@ function improveSectionHeadings() { } else { const annexType = parent.getAttribute('normative') || 'informative'; - numElem.innerHTML = 'Annex ' + section + '
(' + annexType + ')
'; + numElem.innerHTML = + 'Annex ' + section + '
(' + annexType + ')
'; } } else { numElem.textContent = section; @@ -217,7 +237,6 @@ function generateInsideCover() { function generateEcmaCopyrightPage() { const copyrightNotice = document.createElement('div'); - copyrightNotice.classList.add('copyright-notice'); copyrightNotice.innerHTML = '

COPYRIGHT NOTICE

\n\n

© ' + @@ -233,6 +252,7 @@ function generateEcmaCopyrightPage() { function ecma262fixes() { const toc = document.getElementById('toc'); + // eslint-disable-next-line prettier/prettier specContainer.insertBefore(document.getElementById('sec-bibliography'), document.getElementById('sec-colophon')); Array.from(toc.getElementsByTagName('a')).forEach(anchor => { if (anchor.getAttribute('href') === '#sec-colophon') {