forked from Mirrors/gomuks
hicli/send: disable html input by default
This commit is contained in:
parent
5832a935cf
commit
c4d6e487da
1 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
rainbowWithHTML = goldmark.New(format.Extensions, goldmark.WithExtensions(mdext.Math, mdext.CustomEmoji), format.HTMLOptions, goldmark.WithExtensions(rainbow.Extension))
|
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)
|
var htmlToMarkdownForInput = ptr.Clone(format.MarkdownHTMLParser)
|
||||||
|
@ -92,7 +92,7 @@ func (h *HiClient) SendMessage(
|
||||||
text = strings.Replace(text, "\n", "<br>", -1)
|
text = strings.Replace(text, "\n", "<br>", -1)
|
||||||
content = format.HTMLToContent(text)
|
content = format.HTMLToContent(text)
|
||||||
} else if text != "" {
|
} else if text != "" {
|
||||||
content = format.RenderMarkdownCustom(text, defaultWithHTML)
|
content = format.RenderMarkdownCustom(text, defaultNoHTML)
|
||||||
}
|
}
|
||||||
content.MsgType = msgType
|
content.MsgType = msgType
|
||||||
if base != nil {
|
if base != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue