[frontend/mfm] Make URLs and links open in a new tab

This commit is contained in:
Lilian 2024-09-13 05:47:20 +02:00
parent a77b6f2a92
commit a9d42b214a
No known key found for this signature in database

View file

@ -144,6 +144,7 @@ public static class MfmRenderer
{
var el = document.CreateElement("a");
el.SetAttribute("href", node.Url);
el.SetAttribute("target", "_blank");
el.ClassName = "link-node";
return el;
}
@ -182,6 +183,7 @@ public static class MfmRenderer
{
var el = document.CreateElement("a");
el.SetAttribute("href", node.Url);
el.SetAttribute("target", "_blank");
el.ClassName = "url-node";
el.TextContent = node.Url;
return el;