fedimbed: dont wrap anchors in masked link if body is equal to href
This commit is contained in:
parent
a5ee7d3f44
commit
91b351fe73
1 changed files with 1 additions and 1 deletions
|
@ -633,7 +633,7 @@ async function processUrl(msg, url, spoiler = false) {
|
||||||
// FIXME: stop being lazy and use an html parser
|
// FIXME: stop being lazy and use an html parser
|
||||||
content = content.replace(
|
content = content.replace(
|
||||||
/<a .*?href="([^"]+?)".*?>(.+?)<\/a>/gi,
|
/<a .*?href="([^"]+?)".*?>(.+?)<\/a>/gi,
|
||||||
"[$2]($1)"
|
(_, url, text) => (url === text ? url : `[${text}](${url})`)
|
||||||
);
|
);
|
||||||
content = content.replace(
|
content = content.replace(
|
||||||
/<img .*?src="([^"]+?)".*?(alt|title)="([^"]+?)".*?\/>/gi,
|
/<img .*?src="([^"]+?)".*?(alt|title)="([^"]+?)".*?\/>/gi,
|
||||||
|
|
Loading…
Reference in a new issue