Skip to content

Commit b9368b5

Browse files
committed
Lint and format the HTML in using Prettier
The linter found some issues in viewer.html with </input> which isn't required and a missing closing div in test/resources/reftest-analyzer.html. The HTML can now be nicely formatted. In order to not break the build for mozilla-central, the preprocessor has been fixed in order to take into account the white spaces at the beginning of a comment line. And finally, make .prettierrc (which is supposed to be either json or yaml) itself lintable.
1 parent 2640467 commit b9368b5

File tree

23 files changed

+1339
-981
lines changed

23 files changed

+1339
-981
lines changed

.prettierrc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99

1010
"overrides": [
1111
{
12-
files: ["tsconfig.json"],
13-
options: {
14-
parser: "json",
15-
},
12+
"files": ["tsconfig.json", ".prettierrc"],
13+
"options": {
14+
"parser": "json"
15+
}
1616
},
17+
{
18+
"files": ["**/*.html"],
19+
"options": {
20+
"parser": "html",
21+
"printWidth": 160
22+
}
23+
}
1724
]
1825
}
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<!--
33
Copyright 2014 Mozilla Foundation
44
@@ -15,29 +15,29 @@
1515
limitations under the License.
1616
-->
1717
<html dir="ltr" mozdisallowselectionprint>
18-
<head>
19-
<meta charset="utf-8">
20-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
21-
<meta name="google" content="notranslate">
22-
<title>PDF.js page viewer using built components</title>
23-
24-
<style>
25-
body {
26-
background-color: #808080;
27-
margin: 0;
28-
padding: 0;
29-
}
30-
</style>
31-
32-
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css">
33-
34-
<script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script>
35-
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.mjs" type="module"></script>
36-
</head>
37-
38-
<body tabindex="1">
39-
<div id="pageContainer" class="pdfViewer singlePageView"></div>
40-
41-
<script src="pageviewer.mjs" type="module"></script>
42-
</body>
18+
<head>
19+
<meta charset="utf-8" />
20+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
21+
<meta name="google" content="notranslate" />
22+
<title>PDF.js page viewer using built components</title>
23+
24+
<style>
25+
body {
26+
background-color: #808080;
27+
margin: 0;
28+
padding: 0;
29+
}
30+
</style>
31+
32+
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css" />
33+
34+
<script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script>
35+
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.mjs" type="module"></script>
36+
</head>
37+
38+
<body tabindex="1">
39+
<div id="pageContainer" class="pdfViewer singlePageView"></div>
40+
41+
<script src="pageviewer.mjs" type="module"></script>
42+
</body>
4343
</html>
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<!--
33
Copyright 2014 Mozilla Foundation
44
@@ -15,37 +15,37 @@
1515
limitations under the License.
1616
-->
1717
<html dir="ltr" mozdisallowselectionprint>
18-
<head>
19-
<meta charset="utf-8">
20-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
21-
<meta name="google" content="notranslate">
22-
<title>PDF.js viewer using built components</title>
23-
24-
<style>
25-
body {
26-
background-color: #808080;
27-
margin: 0;
28-
padding: 0;
29-
}
30-
#viewerContainer {
31-
overflow: auto;
32-
position: absolute;
33-
width: 100%;
34-
height: 100%;
35-
}
36-
</style>
37-
38-
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css">
39-
40-
<script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script>
41-
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.mjs" type="module"></script>
42-
</head>
43-
44-
<body tabindex="1">
45-
<div id="viewerContainer">
46-
<div id="viewer" class="pdfViewer"></div>
47-
</div>
48-
49-
<script src="simpleviewer.mjs" type="module"></script>
50-
</body>
18+
<head>
19+
<meta charset="utf-8" />
20+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
21+
<meta name="google" content="notranslate" />
22+
<title>PDF.js viewer using built components</title>
23+
24+
<style>
25+
body {
26+
background-color: #808080;
27+
margin: 0;
28+
padding: 0;
29+
}
30+
#viewerContainer {
31+
overflow: auto;
32+
position: absolute;
33+
width: 100%;
34+
height: 100%;
35+
}
36+
</style>
37+
38+
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css" />
39+
40+
<script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script>
41+
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.mjs" type="module"></script>
42+
</head>
43+
44+
<body tabindex="1">
45+
<div id="viewerContainer">
46+
<div id="viewer" class="pdfViewer"></div>
47+
</div>
48+
49+
<script src="simpleviewer.mjs" type="module"></script>
50+
</body>
5151
</html>
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<!--
33
Copyright 2014 Mozilla Foundation
44
@@ -15,37 +15,37 @@
1515
limitations under the License.
1616
-->
1717
<html dir="ltr" mozdisallowselectionprint>
18-
<head>
19-
<meta charset="utf-8">
20-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
21-
<meta name="google" content="notranslate">
22-
<title>PDF.js Single Page Viewer using built components</title>
23-
24-
<style>
25-
body {
26-
background-color: #808080;
27-
margin: 0;
28-
padding: 0;
29-
}
30-
#viewerContainer {
31-
overflow: auto;
32-
position: absolute;
33-
width: 100%;
34-
height: 100%;
35-
}
36-
</style>
37-
38-
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css">
39-
40-
<script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script>
41-
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.mjs" type="module"></script>
42-
</head>
43-
44-
<body tabindex="1">
45-
<div id="viewerContainer">
46-
<div id="viewer" class="pdfViewer"></div>
47-
</div>
48-
49-
<script src="singlepageviewer.mjs" type="module"></script>
50-
</body>
18+
<head>
19+
<meta charset="utf-8" />
20+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
21+
<meta name="google" content="notranslate" />
22+
<title>PDF.js Single Page Viewer using built components</title>
23+
24+
<style>
25+
body {
26+
background-color: #808080;
27+
margin: 0;
28+
padding: 0;
29+
}
30+
#viewerContainer {
31+
overflow: auto;
32+
position: absolute;
33+
width: 100%;
34+
height: 100%;
35+
}
36+
</style>
37+
38+
<link rel="stylesheet" href="../../node_modules/pdfjs-dist/web/pdf_viewer.css" />
39+
40+
<script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script>
41+
<script src="../../node_modules/pdfjs-dist/web/pdf_viewer.mjs" type="module"></script>
42+
</head>
43+
44+
<body tabindex="1">
45+
<div id="viewerContainer">
46+
<div id="viewer" class="pdfViewer"></div>
47+
</div>
48+
49+
<script src="singlepageviewer.mjs" type="module"></script>
50+
</body>
5151
</html>
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<!--
33
Copyright 2018 Mozilla Foundation
44
@@ -15,26 +15,26 @@
1515
limitations under the License.
1616
-->
1717
<html dir="ltr" mozdisallowselectionprint>
18-
<head>
19-
<meta charset="utf-8">
20-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
21-
<meta name="google" content="notranslate">
22-
<title>PDF.js standalone JpegImage parser</title>
18+
<head>
19+
<meta charset="utf-8" />
20+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
21+
<meta name="google" content="notranslate" />
22+
<title>PDF.js standalone JpegImage parser</title>
2323

24-
<style>
25-
body {
26-
background-color: #808080;
27-
margin: 0;
28-
padding: 0;
29-
}
30-
</style>
24+
<style>
25+
body {
26+
background-color: #808080;
27+
margin: 0;
28+
padding: 0;
29+
}
30+
</style>
3131

32-
<script src="../../node_modules/pdfjs-dist/image_decoders/pdf.image_decoders.mjs" type="module"></script>
33-
</head>
32+
<script src="../../node_modules/pdfjs-dist/image_decoders/pdf.image_decoders.mjs" type="module"></script>
33+
</head>
3434

35-
<body tabindex="1">
36-
<canvas id="jpegCanvas" width="0" height="0"></canvas>
35+
<body tabindex="1">
36+
<canvas id="jpegCanvas" width="0" height="0"></canvas>
3737

38-
<script src="jpeg_viewer.mjs" type="module"></script>
39-
</body>
38+
<script src="jpeg_viewer.mjs" type="module"></script>
39+
</body>
4040
</html>

0 commit comments

Comments
 (0)