mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
Fix mention of long format notes
This commit is contained in:
15
utils.go
15
utils.go
@@ -28,7 +28,7 @@ const (
|
|||||||
var (
|
var (
|
||||||
urlSuffixMatcher = regexp.MustCompile(`[\w-_.]+\.[\w-_.]+(\/[\/\w]*)?$`)
|
urlSuffixMatcher = regexp.MustCompile(`[\w-_.]+\.[\w-_.]+(\/[\/\w]*)?$`)
|
||||||
nostrEveryMatcher = regexp.MustCompile(`nostr:((npub|note|nevent|nprofile|naddr)1[a-z0-9]+)\b`)
|
nostrEveryMatcher = regexp.MustCompile(`nostr:((npub|note|nevent|nprofile|naddr)1[a-z0-9]+)\b`)
|
||||||
nostrNoteNeventMatcher = regexp.MustCompile(`nostr:((note|nevent)1[a-z0-9]+)\b`)
|
nostrNoteNeventMatcher = regexp.MustCompile(`nostr:((note|nevent|naddr)1[a-z0-9]+)\b`)
|
||||||
nostrNpubNprofileMatcher = regexp.MustCompile(`nostr:((npub|nprofile)1[a-z0-9]+)\b`)
|
nostrNpubNprofileMatcher = regexp.MustCompile(`nostr:((npub|nprofile)1[a-z0-9]+)\b`)
|
||||||
|
|
||||||
urlMatcher = func() *regexp.Regexp {
|
urlMatcher = func() *regexp.Regexp {
|
||||||
@@ -313,9 +313,16 @@ func renderQuotesAsHTML(ctx context.Context, input string, usingTelegramInstantV
|
|||||||
return nip19
|
return nip19
|
||||||
}
|
}
|
||||||
|
|
||||||
content := fmt.Sprintf(
|
quotedEvent := basicFormatting(match, false, usingTelegramInstantView, false)
|
||||||
`<blockquote class="border-l-05rem border-l-strongpink border-solid"><div class="-ml-4 bg-gradient-to-r from-gray-100 dark:from-zinc-800 to-transparent mr-0 mt-0 mb-4 pl-4 pr-2 py-2">quoting %s </div> %s </blockquote>`, match, event.Content)
|
content := ""
|
||||||
return basicFormatting(content, false, usingTelegramInstantView, false)
|
if event.Kind == 30023 {
|
||||||
|
content = mdToHTML(event.Content, usingTelegramInstantView, false)
|
||||||
|
} else {
|
||||||
|
content = basicFormatting(event.Content, false, usingTelegramInstantView, false)
|
||||||
|
}
|
||||||
|
content = fmt.Sprintf(
|
||||||
|
`<blockquote class="border-l-05rem border-l-strongpink border-solid"><div class="-ml-4 bg-gradient-to-r from-gray-100 dark:from-zinc-800 to-transparent mr-0 mt-0 mb-4 pl-4 pr-2 py-2">quoting %s </div> %s </blockquote>`, quotedEvent, content)
|
||||||
|
return content
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user