feat: enhance location message formatting with HTML for better visibility

This commit is contained in:
2026-06-09 22:50:50 +08:00
parent ac76e98b74
commit e82ed2fdfd
+3 -3
View File
@@ -430,7 +430,7 @@
async function selectBusStop(stop, loadArrivals = false) { async function selectBusStop(stop, loadArrivals = false) {
selectedStop = stop; selectedStop = stop;
locationMessage = `Selected stop: ${stop.description} (${stop.code})`; locationMessage = `Selected stop: <strong>${escapeHtml(stop.description)}</strong> (${stop.code})`;
await updateMap(); await updateMap();
if (loadArrivals) { if (loadArrivals) {
await runArrival(); await runArrival();
@@ -444,7 +444,7 @@
throw new Error("No nearby bus stop found."); throw new Error("No nearby bus stop found.");
} }
locationMessage = `Nearest stop found: ${selectedStop.description} (${selectedStop.code}). Tap another stop in the list or map.`; locationMessage = `Nearest stop found: <strong>${escapeHtml(selectedStop.description)}</strong> (${selectedStop.code}). Tap another stop in the list or map.`;
await updateMap(); await updateMap();
setStatus("Location Ready", "ok"); setStatus("Location Ready", "ok");
@@ -543,7 +543,7 @@
{/if} {/if}
<span class="visually-hidden">{locating ? "Locating..." : "Use Current Location"}</span> <span class="visually-hidden">{locating ? "Locating..." : "Use Current Location"}</span>
</button> </button>
<p class="hint">{locationMessage}</p> <p class="hint">{@html locationMessage}</p>
</div> </div>
</div> </div>
</div> </div>