Got a unified timeline working

This commit is contained in:
Thomas Mathews 2022-12-16 15:15:33 -08:00
parent 00edee1cb3
commit f417732942
8 changed files with 224 additions and 51 deletions

View file

@ -1,7 +1,12 @@
function linkify(text, show_media) {
return text.replace(URL_REGEX, function(match, p1, p2, p3) {
const url = p2+p3
const parsed = new URL(url)
const url = p2+p3;
let parsed;
try {
parsed = new URL(url)
} catch (err) {
return match;
}
let html;
if (show_media && is_img_url(parsed.pathname)) {
html = `