Apply a gentle highlight on nostr links

This commit is contained in:
Daniele Tonon
2023-06-04 17:06:13 +02:00
parent c47a6ba4f5
commit 7adc9b2f75
4 changed files with 20 additions and 2 deletions

View File

@@ -233,7 +233,7 @@ func replaceURLsWithTags(line string) string {
capturedGroup := submatch[2]
first6 := capturedGroup[:6]
last6 := capturedGroup[len(capturedGroup)-6:]
replacement := fmt.Sprintf(`<a href="/%s">%s</a>`, capturedGroup, first6+"…"+last6)
replacement := fmt.Sprintf(`<a href="/%s" class="nostr">%s</a>`, capturedGroup, first6+"…"+last6)
return replacement
})