simplify markdown embed handling

This commit is contained in:
TomatoCake 2024-07-14 15:58:28 +02:00
parent a83c1203ab
commit 344023e025

View file

@ -59,7 +59,7 @@ class Embed{
embed.append(authorline); embed.append(authorline);
} }
const title=document.createElement("a"); const title=document.createElement("a");
title.innerHTML=markdown(this.json.title).innerHTML; title.append(markdown(this.json.title));
if(this.json.url){ if(this.json.url){
title.href=this.json.url; title.href=this.json.url;
} }
@ -68,7 +68,7 @@ class Embed{
if(this.json.description){ if(this.json.description){
const p=document.createElement("p"); const p=document.createElement("p");
p.innerHTML=markdown(this.json.description).innerHTML; p.append(markdown(this.json.description));
embed.append(p); embed.append(p);
} }
@ -80,7 +80,7 @@ class Embed{
b.textContent=thing.name; b.textContent=thing.name;
div.append(b); div.append(b);
const p=document.createElement("p") const p=document.createElement("p")
p.innerHTML=markdown(thing.value).innerHTML; p.append(markdown(thing.value));
p.classList.add("embedp"); p.classList.add("embedp");
div.append(p); div.append(p);