ソースを参照

fix(cmd): do not process mentions in fenced codeblock

ayn2op 6 ヶ月 前
コミット
cba89ee406
1 ファイル変更1 行追加1 行削除
  1. 1 1
      cmd/message_input.go

+ 1 - 1
cmd/message_input.go

@@ -210,7 +210,7 @@ func processText(cID discord.ChannelID, src []byte) string {
 
 	ast.Walk(discordmd.Parse(src), func(node ast.Node, enter bool) (ast.WalkStatus, error) {
 		switch node := node.(type) {
-		case *ast.CodeBlock:
+		case *ast.CodeBlock, *ast.FencedCodeBlock:
 			canMention = !enter
 		case *discordmd.Inline:
 			if (node.Attr & discordmd.AttrMonospace) != 0 {