Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-04-12 21:48:47 +08:00
parent ae96f95887
commit 12feeeaa64
26 changed files with 3820 additions and 2511 deletions

View File

@@ -78,7 +78,7 @@ func PostMML2ToNF(w http.ResponseWriter, r *http.Request) {
return
}
var buf [20 * 1024]byte
var buf [100 * 1024]byte
//buf := make([]byte, 0)
var n int
var mmlResult []string
@@ -172,7 +172,7 @@ func PostMML2ToNF(w http.ResponseWriter, r *http.Request) {
//re2 := regexp.MustCompile(`\x00`) // 匹配空字符
re2 := regexp.MustCompile(`[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x1B]`) // 匹配空字符和包含␛的控制字符
//re := regexp.MustCompile(`[\x00-\x1F\x7F]`)
result := re1.ReplaceAllString(string(buf[0:n-len(neType)-2]), "")
result := re1.ReplaceAllString(string(buf[0:n]), "")
result = re2.ReplaceAllString(result, "")
mmlResult = append(mmlResult, result)
}