fix links

This commit is contained in:
Daniella / Tove 2022-01-19 07:42:10 +01:00 committed by GitHub
parent 4979a96712
commit 8ba78a8e69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,7 +103,7 @@
`<post><div class="content">${date ? (`<h6>${date.toUTCString()}</h6>`) : ''}<h3>${post.author.replaceAll('<','&lt;').replaceAll('>','&gt;')}: ${post.title.replaceAll('<','&lt;').replaceAll('>','&gt;')}</h3>` +
post.content.replaceAll('<','&lt;').replaceAll('>','&gt;')
.replaceAll('[* ', '<i>').replaceAll(' *]', '</i>')
.replaceAll(/(https?:\/\/[^ \n]+)/g, '<a href="$1" target="blank">$1</a>')
.replaceAll(/(https?:\/\/[^ \n]+)/g, '<a href="$1" target="_blank">$1</a>')
.replaceAll('[** ', '<b>').replaceAll(' **]', '</b>')
.replaceAll('[*** ', '<b><i>').replaceAll(' ***]', '</i></b>')
.replaceAll('[_ ', '<u>').replaceAll(' _]', '</u>')