Also handle problematic hyphens
This commit is contained in:
parent
83aa11c5d0
commit
ceb3df2fdb
|
@ -22,7 +22,7 @@ const itemLinkRegExp = name => new RegExp(`<a href="/lodestone/playguide/db/item
|
||||||
*/
|
*/
|
||||||
export async function findItemEDBID (name) {
|
export async function findItemEDBID (name) {
|
||||||
// execute a search for the item's name
|
// execute a search for the item's name
|
||||||
const searchURL = `https://na.finalfantasyxiv.com/lodestone/playguide/db/item/?q=${encodeURIComponent(name.replace(/\([^)]+\)|&/g, ' '))}`;
|
const searchURL = `https://na.finalfantasyxiv.com/lodestone/playguide/db/item/?q=${encodeURIComponent(name.replace(/\([^)]+\)|[&-]/g, ' '))}`;
|
||||||
const response = await fetch(searchURL);
|
const response = await fetch(searchURL);
|
||||||
const body = await response.text();
|
const body = await response.text();
|
||||||
// find an `<a>` in the HTML response whose text exactly matches the name
|
// find an `<a>` in the HTML response whose text exactly matches the name
|
||||||
|
|
Loading…
Reference in a new issue