[pl][blog] fix displaying favicons

This commit is contained in:
Andrea 2022-06-08 09:23:11 +02:00
parent b6c0c8c074
commit cf4e003dea
1 changed files with 1 additions and 1 deletions

View File

@ -68,10 +68,10 @@ export default async function parseMarkdown(markdown) {
markdown markdown
.replace(/<table>/g, '<div class="table-responsive"><table class="table table-striped small">') .replace(/<table>/g, '<div class="table-responsive"><table class="table table-striped small">')
.replace(/<\/table>/g, '</table></div>') .replace(/<\/table>/g, '</table></div>')
.replace(/{favicon=(.+?)}/g, '<img src="https://$1" alt="Favicon" style="width: 1em; height: 1em;"/>')
.replace(/<a href="http/g, '<a target="_blank" rel="noopener" href="http') .replace(/<a href="http/g, '<a target="_blank" rel="noopener" href="http')
.replace(/<p>{details=(.+?)}<\/p>(.+?)<p>{\/details}<\/p>/gms, '<details class="border mb-3"><summary class="bg-light p-3">$1</summary><div class="border-top p-3 bg-white">$2</div></details>') .replace(/<p>{details=(.+?)}<\/p>(.+?)<p>{\/details}<\/p>/gms, '<details class="border mb-3"><summary class="bg-light p-3">$1</summary><div class="border-top p-3 bg-white">$2</div></details>')
.replace(/<img (.*?)>/g, '<div class="text-center"><img $1 class="border"></div>') .replace(/<img (.*?)>/g, '<div class="text-center"><img $1 class="border"></div>')
.replace(/{favicon=(.+?)}/g, '<img src="https://$1" alt="Favicon" style="width: 1em; height: 1em;"/>')
.replace(/{embed=\/\/(.+?)=(.+?)}/g, '<div style="position: relative;height: 0;padding-bottom: 56.25%;"><iframe src="https://$1" title="$2" allowfullscreen sandbox="allow-same-origin allow-scripts allow-popups" style="position: absolute;top: 0; left: 0;width: 100%;height: 100%;border:0;"></iframe></div>') .replace(/{embed=\/\/(.+?)=(.+?)}/g, '<div style="position: relative;height: 0;padding-bottom: 56.25%;"><iframe src="https://$1" title="$2" allowfullscreen sandbox="allow-same-origin allow-scripts allow-popups" style="position: absolute;top: 0; left: 0;width: 100%;height: 100%;border:0;"></iframe></div>')
.replace(/{graph=([^}]+)}/g, '<iframe class="graph" src="$1.html" loading="lazy"></iframe>') .replace(/{graph=([^}]+)}/g, '<iframe class="graph" src="$1.html" loading="lazy"></iframe>')
.replace(/<p>{census_groups}<\/p>(.+?)<p>{\/census_groups}<\/p>/gms, mainPlusDetails(census_groups, false)) .replace(/<p>{census_groups}<\/p>(.+?)<p>{\/census_groups}<\/p>/gms, mainPlusDetails(census_groups, false))