mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
Remove duplicate title inside the body
This commit is contained in:
@@ -125,6 +125,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
|||||||
for _, tag := range data.event.Tags {
|
for _, tag := range data.event.Tags {
|
||||||
if tag[0] == "subject" || tag[0] == "title" {
|
if tag[0] == "subject" || tag[0] == "title" {
|
||||||
subject = tag[1]
|
subject = tag[1]
|
||||||
|
|
||||||
}
|
}
|
||||||
if tag[0] == "summary" {
|
if tag[0] == "summary" {
|
||||||
summary = tag[1]
|
summary = tag[1]
|
||||||
@@ -264,6 +265,8 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
|||||||
data.content = strings.ReplaceAll(data.content, placeholderTag, "nostr:"+nreplace)
|
data.content = strings.ReplaceAll(data.content, placeholderTag, "nostr:"+nreplace)
|
||||||
}
|
}
|
||||||
if data.event.Kind == 30023 || data.event.Kind == 30024 {
|
if data.event.Kind == 30023 || data.event.Kind == 30024 {
|
||||||
|
// Remove duplicate title inside the body
|
||||||
|
data.content = strings.ReplaceAll(data.content, "# "+subject, "")
|
||||||
data.content = mdToHTML(data.content, data.templateId == TelegramInstantView, false)
|
data.content = mdToHTML(data.content, data.templateId == TelegramInstantView, false)
|
||||||
} else {
|
} else {
|
||||||
// first we run basicFormatting, which turns URLs into their appropriate HTML tags
|
// first we run basicFormatting, which turns URLs into their appropriate HTML tags
|
||||||
|
|||||||
Reference in New Issue
Block a user