mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-18 06:41:27 +02:00
A browser-based roguelike synchronized with crypto block timing. A run is a race against the next block: reach the exit before the block lands, or the house wins. The same codebase runs the solo dungeon, the social Tavern, and operator-selected PvP and race rulesets, with separate free and paid leaderboards. Self-hostable under the MIT License. See README.md to run it, docs/ARCHITECTURE.md for the design, and docs/DEPLOY.md to operate an instance.
19 lines
749 B
JavaScript
19 lines
749 B
JavaScript
/**
|
|
* Shared HTML-escaping helper: the single source of truth for escaping untrusted
|
|
* (server- or user-supplied) text before it is inserted into innerHTML / jQuery .html().
|
|
* Escapes all five HTML-significant characters, including both quote types so the
|
|
* result is safe in both element text and quoted attribute values.
|
|
*/
|
|
(function (global) {
|
|
function escapeHtml(value) {
|
|
if (value === null || value === undefined) return '';
|
|
return String(value)
|
|
.replace(/&/g, '&')
|
|
.replace(/</g, '<')
|
|
.replace(/>/g, '>')
|
|
.replace(/"/g, '"')
|
|
.replace(/'/g, ''');
|
|
}
|
|
global.escapeHtml = escapeHtml;
|
|
})(typeof window !== 'undefined' ? window : this);
|