fedimbed: try non-strict equality for anchor tags

This commit is contained in:
Cynthia Foxwell 2024-01-15 14:28:41 -07:00
parent 91b351fe73
commit 7dcd23d93d

View file

@ -633,7 +633,7 @@ async function processUrl(msg, url, spoiler = false) {
// FIXME: stop being lazy and use an html parser
content = content.replace(
/<a .*?href="([^"]+?)".*?>(.+?)<\/a>/gi,
(_, url, text) => (url === text ? url : `[${text}](${url})`)
(_, url, text) => (url == text ? url : `[${text}](${url})`)
);
content = content.replace(
/<img .*?src="([^"]+?)".*?(alt|title)="([^"]+?)".*?\/>/gi,