Fix link to lexemes, fix #507

This commit is contained in:
pietervdvn 2021-10-10 23:50:50 +02:00
parent ed161afc7e
commit 5f5079ddfe
2 changed files with 10 additions and 1 deletions

View file

@ -273,6 +273,15 @@ export default class Wikidata {
return undefined;
}
public static IdToArticle(id: string){
if(id.startsWith("Q")){
return "https://wikidata.org/wiki/"+id
}
if(id.startsWith("L")){
return "https://wikidata.org/wiki/Lexeme:"+id
}
throw "Unknown id type: "+id
}
/**
* Loads a wikidata page

View file

@ -51,7 +51,7 @@ export default class WikidataPreviewBox extends VariableUiElement {
wikidata.id,
Svg.wikidata_ui().SetStyle("width: 2.5rem").SetClass("block")
]).SetClass("flex"),
"https://wikidata.org/wiki/"+wikidata.id ,true).SetClass("must-link")
Wikidata.IdToArticle(wikidata.id) ,true).SetClass("must-link")
console.log(wikidata)
let info = new Combine( [