Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Info boxes are not correct for Fandom via wtf-plugin-person #579

Open
MarketingPip opened this issue Nov 25, 2024 · 1 comment
Open
Labels

Comments

@MarketingPip
Copy link
Contributor

MarketingPip commented Nov 25, 2024

Just doing my regular play and reporting...

Not sure other Wikis affected by this but..

doc.infobox().keyValue()["birth date"]

Gets the valid birthdate etc...

Where as -

byInfobox(doc, "birth date")

Does not.

The library is CURRENTLY using

byInfobox(doc, 'birth_date')

Maybe a default fallback if not those - try info box for keyvalue?

JS to make your life easier:

characterInfo:{
  birthDate: doc.infobox().keyValue()["birth date"] || "Unknown",
  fullName: doc.infobox().keyValue()["full name"] || "Not available",
  birthPlace: doc.infobox().keyValue()["birth place"] || "Not specified",
  gender: doc.infobox().keyValue()["gender"] || "Not specified",
  nationality: doc.infobox().keyValue()["nationality"] || "Not specified",
  occupation: doc.infobox().keyValue()["occupation"] || "Not specified",
  spouse: doc.infobox().keyValue()["spouse"] || "Not available",
  children: doc.infobox().keyValue()["children"] || "Not specified",
  knownFor: doc.infobox().keyValue()["known for"] || "Not specified",
  alias: doc.infobox().keyValue()["alias"] || "Not available",
  height: doc.infobox().keyValue()["height"] || "Not specified",
  weight: doc.infobox().keyValue()["weight"] || "Not specified",
  dateOfDeath: doc.infobox().keyValue()["date of death"] || "Not applicable",
  causeOfDeath: doc.infobox().keyValue()["cause of death"] || "Not specified",
  relatives: doc.infobox().keyValue()["relatives"] || "Not available",
  notableWorks: doc.infobox().keyValue()["notable works"] || "Not specified",
  awards: doc.infobox().keyValue()["awards"] || "Not specified",
  education: doc.infobox().keyValue()["education"] || "Not specified",
  residence: doc.infobox().keyValue()["residence"] || "Not specified",
  citizenship: doc.infobox().keyValue()["citizenship"] || "Not specified"
}
@spencermountain
Copy link
Owner

hey Jared - ya, you're right. The property names are really brittle, and I was hoping to normalize them but have ended up making things less-clear perhaps.
Will put this on the list for v11, as it's a breaking change.
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants