release: v1.0.1 — fix Go libweb dynamic-route query, Markdown, CSS false positives

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-15 14:48:47 +08:00
1 parent 761b92afce
commit 3eb8e732ea
17 files changed
+375 -43

No files matched your search

+20 -2
View File
@@ -38,12 +38,30 @@ func TestStyleStrictKeepsQuotedSlash(t *testing.T) {
}
}
func TestStyleStrictRejectsNumeric(t *testing.T) {
func TestStyleStrictAllowsNumeric(t *testing.T) {
css, err := style.Style(map[string]any{
"name": "x",
"strict": true,
"table": []any{
map[string]any{"选择器": ".x", "属性": "z-index", "值": float64(20)},
map[string]any{"选择器": ".y", "属性": "opacity", "值": float64(0.5)},
map[string]any{"选择器": ".z", "属性": "font-weight", "值": float64(700)},
},
})
if err != nil {
t.Fatalf("numeric CSS must not be suspicious: %v", err)
}
if !strings.Contains(css, "z-index: 20") || !strings.Contains(css, "opacity: 0.5") {
t.Fatalf("%q", css)
}
}
func TestStyleStrictRejectsBoolean(t *testing.T) {
_, err := style.Style(map[string]any{
"name": "x",
"strict": true,
"table": []any{
map[string]any{"选择器": ".x", "属性": "grid-column", "值": float64(0)},
map[string]any{"选择器": ".x", "属性": "display", "值": true},
},
})
if err == nil || !strings.Contains(err.Error(), "suspicious") {