UNPKG

epicwar

Version:
19 lines (18 loc) 633 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMapDescription = void 0; function getMapDescription(cells) { for (const cell of cells) { const content = cell.textContent; if (content.indexOf('Share this map') === -1) { continue; } const innerHTML = cell.innerHTML; const html = innerHTML .split(/by <b>(.*?)<\/b><br><br>/gm)[2].trim() .split(/<br><br>\n\s+<b>((Rate this map)|(You rated this map)): <\/b>/gm)[0].trim(); return html; } return null; } exports.getMapDescription = getMapDescription;