对漏洞描述部分添加 markdown 标签转义,防止部分标签不闭合导致格式解析错误,有些 IM 格式校验比较严格(tg),推送时会直接报错
添加最大描述长度限制(500个中文字符)和引用最多链接个数(8个),增强可读性
单元测试:
testCases := []struct {
name string
inputDescription string
expected string
}{
{
name: "escape underscores",
inputDescription: "I Doc View。2023年11月,官方发布13.10.1_20231115版本,修复相关漏洞。",
expected: "I Doc View。2023年11月,官方发布13.10.1\\_20231115版本,修复相关漏洞。",
},
{
name: "escape asterisks",
inputDescription: "This is not a *bold text",
expected: "This is not a \\*bold text",
},
}
针对 markdown 格式推送添加了两个限制
单元测试: