mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 08:38:30 -07:00
Add placeholder for missing fighter names
This commit is contained in:
1 parent
e129ffa7c3
commit
95a9ffd977
1 file changed
+12
-11
+12
-11
@@ -86,17 +86,18 @@ function convertLiToStr(li: HTMLElement) {
|
|||||||
else if (bout.includes("Catchweight")) weightClass = "CW";
|
else if (bout.includes("Catchweight")) weightClass = "CW";
|
||||||
|
|
||||||
// Extract and format fighter names with weightclass
|
// Extract and format fighter names with weightclass
|
||||||
const red = li
|
const red =
|
||||||
.querySelector(".c-listing-fight__corner-name--red")
|
li
|
||||||
?.textContent?.replaceAll("\n", "")
|
.querySelector(".c-listing-fight__corner-name--red")
|
||||||
.replace(/\s+/g, " ")
|
?.textContent?.replaceAll("\n", "")
|
||||||
.trim();
|
.replace(/\s+/g, " ")
|
||||||
const blue = li
|
.trim() || "___";
|
||||||
.querySelector(".c-listing-fight__corner-name--blue")
|
const blue =
|
||||||
?.textContent?.replaceAll("\n", "")
|
li
|
||||||
.replace(/\s+/g, " ")
|
.querySelector(".c-listing-fight__corner-name--blue")
|
||||||
.trim();
|
?.textContent?.replaceAll("\n", "")
|
||||||
if (!red || !blue) throw new Error("Failed to retrieve fighter names");
|
.replace(/\s+/g, " ")
|
||||||
|
.trim() || "___";
|
||||||
|
|
||||||
const ranks = li
|
const ranks = li
|
||||||
.querySelectorAll(
|
.querySelectorAll(
|
||||||
|
|||||||
Reference in new issue
Block a user