Fix wiki links on mobile
This commit is contained in:
parent
641b59bca5
commit
a2bec35a43
1 changed files with 3 additions and 2 deletions
5
index.ts
5
index.ts
|
@ -76,8 +76,8 @@ if (layoutFromBase64.startsWith("wiki:")) {
|
||||||
data = data.substr(start,
|
data = data.substr(start,
|
||||||
data.indexOf("<div class=\"printfooter\">") - start)
|
data.indexOf("<div class=\"printfooter\">") - start)
|
||||||
data = data.substr(0, data.lastIndexOf("</p>"))
|
data = data.substr(0, data.lastIndexOf("</p>"))
|
||||||
data = data.substr(startTrigger.length + 3);
|
data = data.substr( data.indexOf("<p>") + 3)
|
||||||
|
console.log(data)
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(data);
|
const parsed = JSON.parse(data);
|
||||||
parsed["id"] = layoutFromBase64
|
parsed["id"] = layoutFromBase64
|
||||||
|
@ -87,6 +87,7 @@ if (layoutFromBase64.startsWith("wiki:")) {
|
||||||
new FixedUiElement(`<a href="${cleanUrl}">${themeName}</a> is invalid:<br/>${e}`)
|
new FixedUiElement(`<a href="${cleanUrl}">${themeName}</a> is invalid:<br/>${e}`)
|
||||||
.SetClass("clickable")
|
.SetClass("clickable")
|
||||||
.AttachTo("centermessage");
|
.AttachTo("centermessage");
|
||||||
|
console.error("Could not parse the text", data)
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue