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