From c4d6e487da07c87ed601f813365498825464e025 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 2 Nov 2024 14:02:37 +0200 Subject: [PATCH] hicli/send: disable html input by default --- pkg/hicli/send.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/hicli/send.go b/pkg/hicli/send.go index daedbde..07fcef9 100644 --- a/pkg/hicli/send.go +++ b/pkg/hicli/send.go @@ -31,7 +31,7 @@ import ( var ( rainbowWithHTML = goldmark.New(format.Extensions, goldmark.WithExtensions(mdext.Math, mdext.CustomEmoji), format.HTMLOptions, goldmark.WithExtensions(rainbow.Extension)) - defaultWithHTML = goldmark.New(format.Extensions, goldmark.WithExtensions(mdext.Math, mdext.CustomEmoji), format.HTMLOptions) + defaultNoHTML = goldmark.New(format.Extensions, goldmark.WithExtensions(mdext.Math, mdext.CustomEmoji, mdext.EscapeHTML), format.HTMLOptions) ) var htmlToMarkdownForInput = ptr.Clone(format.MarkdownHTMLParser) @@ -92,7 +92,7 @@ func (h *HiClient) SendMessage( text = strings.Replace(text, "\n", "
", -1) content = format.HTMLToContent(text) } else if text != "" { - content = format.RenderMarkdownCustom(text, defaultWithHTML) + content = format.RenderMarkdownCustom(text, defaultNoHTML) } content.MsgType = msgType if base != nil {