mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 00:38:30 -07:00
Fix location formatting
This commit is contained in:
1 parent
95a9ffd977
commit
22bef75c69
1 file changed
+7
-2
+7
-2
@@ -147,8 +147,11 @@ async function getDetailsFromEventURL(url: URL) {
|
||||
let location =
|
||||
root
|
||||
.querySelector(".field--name-venue")
|
||||
?.innerText.replaceAll("\n", "")
|
||||
.replaceAll(" ", " ") || "";
|
||||
?.innerText.replaceAll(",", "")
|
||||
.split("\n")
|
||||
.filter((str) => str)
|
||||
.map((str) => str.trim())
|
||||
.join(", ") || "";
|
||||
let fightCard: string[] = [];
|
||||
let mainCard: string[] = [];
|
||||
let prelims: string[] = [];
|
||||
@@ -231,3 +234,5 @@ async function getAllDetailedEvents() {
|
||||
}
|
||||
|
||||
export { getAllDetailedEvents };
|
||||
|
||||
getDetailsFromEventURL(new URL("https://www.ufc.com/event/ufc-312"));
|
||||
Reference in new issue
Block a user