From 9e83faa02c136da9e4749b696d8c7a0b363c0745 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 30 Jan 2021 20:44:54 -0500 Subject: Html lint (#1336) * Move style rules * Fix non-unique IDs * Remove erroneous ids * Add title * Fix invalid closing tag * Install html-validate * Add .htmlvalidate.json * Update HTML and styles * Add test-lint-html * Update test files * Update test-lint-html/css commands to have more explicit targets --- ext/bg/background.html | 3 ++- ext/bg/css/settings2.css | 25 +++++++++++++++++-------- ext/bg/js/permissions-main.js | 4 +++- ext/bg/legal.html | 6 ------ ext/bg/permissions.html | 4 ++-- ext/bg/pitch-accents-preview.html | 2 +- ext/bg/search.html | 2 +- ext/bg/settings.html | 18 +++++++++--------- ext/bg/settings2.html | 31 +++++++++++++------------------ ext/bg/template-renderer.html | 2 +- ext/bg/welcome.html | 8 -------- ext/fg/float.html | 2 +- ext/mixed/display-templates.html | 10 +++++----- 13 files changed, 55 insertions(+), 62 deletions(-) (limited to 'ext') diff --git a/ext/bg/background.html b/ext/bg/background.html index 29cae072..29cd1d85 100644 --- a/ext/bg/background.html +++ b/ext/bg/background.html @@ -2,7 +2,7 @@ - + Background @@ -53,6 +53,7 @@ This element must appear directly inside the element, and it must not be closed properly. https://bugzilla.mozilla.org/show_bug.cgi?id=1603985 --> +
diff --git a/ext/bg/css/settings2.css b/ext/bg/css/settings2.css index 01c19af4..c0751d47 100644 --- a/ext/bg/css/settings2.css +++ b/ext/bg/css/settings2.css @@ -150,6 +150,10 @@ code { label { cursor: pointer; } +pre { + white-space: pre-wrap; + margin: 0; +} /* Text styles */ @@ -1462,15 +1466,8 @@ button.anki-card-field-value-menu-button { border-collapse: collapse; border-spacing: 0; } -.anki-field-marker-info-table>thead { - font-weight: bold; -} -code.anki-field-marker { - white-space: nowrap; - font-size: 0.85em; +.anki-field-marker-info-table tr.anki-field-marker-info-table-heading { font-weight: bold; -} -.anki-field-marker-info-table thead tr { background-color: var(--input-background-color); } .anki-field-marker-info-table td { @@ -1485,6 +1482,11 @@ code.anki-field-marker { .anki-field-marker-info-table td:nth-last-child(n+2) { border-right: none; } +code.anki-field-marker { + white-space: nowrap; + font-size: 0.85em; + font-weight: bold; +} .anki-card-templates-layout { display: flex; @@ -1948,6 +1950,13 @@ input.sentence-termination-character-input2 { padding-left: 0.375em; } +.inline-icon { + position: relative; + width: calc(1em * (16 / var(--font-size-no-units))); + height: calc(1em * (16 / var(--font-size-no-units))); + top: calc(1em * (3 / var(--font-size-no-units))); +} + /* Generic layouts */ .margin-above { diff --git a/ext/bg/js/permissions-main.js b/ext/bg/js/permissions-main.js index cd03dd72..366a057b 100644 --- a/ext/bg/js/permissions-main.js +++ b/ext/bg/js/permissions-main.js @@ -82,7 +82,9 @@ async function updatePermissionCheckbox(checkbox, permissions, value) { const documentFocusController = new DocumentFocusController(); documentFocusController.prepare(); - document.querySelector('#extension-id-example').textContent = chrome.runtime.getURL('/'); + for (const node of document.querySelectorAll('.extension-id-example')) { + node.textContent = chrome.runtime.getURL('/'); + } api.forwardLogsToBackend(); await yomichan.prepare(); diff --git a/ext/bg/legal.html b/ext/bg/legal.html index 85d782a5..3a829abb 100644 --- a/ext/bg/legal.html +++ b/ext/bg/legal.html @@ -13,12 +13,6 @@ - diff --git a/ext/bg/permissions.html b/ext/bg/permissions.html index 05266b22..57b4b215 100644 --- a/ext/bg/permissions.html +++ b/ext/bg/permissions.html @@ -55,7 +55,7 @@ as this can be used to fingerprint browser configuration.

- Example: Origin: + Example: Origin:

@@ -70,7 +70,7 @@ as this can be used to fingerprint browser configuration.

- Example: Origin: + Example: Origin:

diff --git a/ext/bg/pitch-accents-preview.html b/ext/bg/pitch-accents-preview.html index 3adae422..b449222b 100644 --- a/ext/bg/pitch-accents-preview.html +++ b/ext/bg/pitch-accents-preview.html @@ -35,7 +35,7 @@ Graph - - + diff --git a/ext/bg/search.html b/ext/bg/search.html index b5e8f746..4537fb85 100644 --- a/ext/bg/search.html +++ b/ext/bg/search.html @@ -46,7 +46,7 @@
- +
diff --git a/ext/bg/settings.html b/ext/bg/settings.html index 2ccb7a1e..b0a44437 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -2,7 +2,7 @@ - + Yomichan Options (Old) @@ -458,10 +458,10 @@
Prevent middle mouse button actions on:
-
-
-
-
+
+
+
+
@@ -702,7 +702,7 @@
- +

Dictionaries

@@ -886,7 +886,7 @@
- +

@@ -908,7 +908,7 @@
- +

Anki Options

@@ -1264,7 +1264,7 @@ countless hours that I have devoted to this extension.

- +

diff --git a/ext/bg/settings2.html b/ext/bg/settings2.html index 7409541f..c8dee2c4 100644 --- a/ext/bg/settings2.html +++ b/ext/bg/settings2.html @@ -2185,9 +2185,9 @@