Add an option to basicFormatting to skip links

SQUASH
This commit is contained in:
Daniele Tonon
2023-11-28 19:51:43 +01:00
parent 35d053fc87
commit 8a99017259
5 changed files with 13 additions and 9 deletions

View File

@@ -33,7 +33,7 @@ func renderEmbedded(w http.ResponseWriter, r *http.Request, code string) {
data.content = mdToHTML(data.content, data.templateId == TelegramInstantView)
} else {
// first we run basicFormatting, which turns URLs into their appropriate HTML tags
data.content = basicFormatting(html.EscapeString(data.content), true, false)
data.content = basicFormatting(html.EscapeString(data.content), true, false, false)
// then we render quotes as HTML, which will also apply basicFormatting to all the internal quotes
data.content = renderQuotesAsHTML(r.Context(), data.content, data.templateId == TelegramInstantView)
// we must do this because inside <blockquotes> we must treat <img>s differently when telegram_instant_view