fix conversion layout (button below input), add missing closing divs, add HTML div-balance test

This commit is contained in:
2026-08-09 22:47:49 +03:00
parent 9510813e78
commit c0d69040d5
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -535,7 +535,7 @@
<option value="plmn">MCC,MNC → PLMNsel</option>
<option value="plmnwact">MCC,MNC,AcT → PLMNwAcT</option>
</select>
<div class="flex gap-2 mb-2">
<div class="flex flex-col gap-2 mb-2">
<input id="conv-input" class="font-mono flex-1 border border-gray-300 dark:border-slate-600 text-sm rounded px-2 py-1.5 dark:bg-slate-800">
<button onclick="genConvert()" class="px-3 py-1.5 bg-blue-600 text-white text-xs font-medium rounded hover:bg-blue-700" data-l10n="Convert">Convert</button>
</div>
@@ -564,6 +564,7 @@
<textarea id="conv-result" rows="3" readonly class="w-full font-mono border border-gray-300 dark:border-slate-600 text-xs rounded px-2 py-1.5 mt-2 bg-white dark:bg-slate-800"></textarea>
</div>
</div>
</div>
</div>
<div id="tab-sp" class="tab-content hidden">
+12
View File
@@ -0,0 +1,12 @@
const { test } = require('node:test');
const assert = require('node:assert');
const fs = require('node:fs');
const path = require('node:path');
const html = fs.readFileSync(path.join(__dirname, '..', 'index.html'), 'utf8');
const opens = (html.match(/<div\b/g) || []).length;
const closes = (html.match(/<\/div>/g) || []).length;
test('HTML <div> tags are balanced', () => {
assert.strictEqual(opens, closes, `Unbalanced divs: ${opens} opens vs ${closes} closes`);
});