mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
refactor regexes for HTML replacing stuff so another telegram instant view bug is fixed.
now with images inside blockquotes (from quoted events).
This commit is contained in:
@@ -308,7 +308,11 @@ func render(w http.ResponseWriter, r *http.Request) {
|
||||
if event.Kind == 30023 || event.Kind == 30024 {
|
||||
content = mdToHTML(content, typ == "telegram_instant_view")
|
||||
} else {
|
||||
content = basicFormatting(renderQuotesAsHTML(r.Context(), html.EscapeString(content)))
|
||||
// first we run basicFormatting, which turns URLs into their appropriate HTML tags
|
||||
content = basicFormatting(html.EscapeString(content), true, false)
|
||||
// then we render quotes as HTML, which will also apply basicFormatting to all the internal quotes
|
||||
content = renderQuotesAsHTML(r.Context(), content, typ == "telegram_instant_view")
|
||||
// we must do this because inside <blockquotes> we must treat <img>s different when telegram_instant_view
|
||||
}
|
||||
|
||||
// pretty JSON
|
||||
|
||||
Reference in New Issue
Block a user