zema1 / watchvuln

一个高价值漏洞采集与推送服务 | collect valueable vulnerability and push it
MIT License
1.37k stars 151 forks source link

fix: Improve message rendering and markdown handling in push module #67

Closed moonD4rk closed 6 months ago

moonD4rk commented 7 months ago

针对 markdown 格式推送添加了两个限制

单元测试:

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",
        },
    }
zema1 commented 6 months ago

赞,感谢师傅的 PR,rune 那边的处理我可能都想不到这么细