Skip to content

Commit 3f16dbd

Browse files
committed
fix(preprocess): check if > 0 for context menu
1 parent df89c6f commit 3f16dbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/preprocess/preprocess.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func colorVariableReplace(content string) string {
349349
},
350350
{
351351
Name: "CSS: --spice-subtext",
352-
Regex: `#(b3b3b3|a7a7a7)`,
352+
Regex: "#(b3b3b3|a7a7a7)",
353353
Replacement: func(submatches ...string) string {
354354
return "var(--spice-subtext)"
355355
},
@@ -791,7 +791,7 @@ func removeRTL(input string) string {
791791

792792
func exposeAPIs_main(input string, report patchReporter) string {
793793
inputContextMenu := utils.FindFirstMatch(input, `.*value:"contextmenu"`)
794-
if len(inputContextMenu) > 1 {
794+
if len(inputContextMenu) > 0 {
795795
croppedInput := inputContextMenu[0]
796796
react := utils.FindLastMatch(croppedInput, `([a-zA-Z_\$][\w\$]*)\.useRef`)[1]
797797
candicates := utils.FindLastMatch(croppedInput, `\(\{[^}]*menu:([a-zA-Z_\$][\w\$]*),[^}]*trigger:([a-zA-Z_\$][\w\$]*),[^}]*triggerRef:([a-zA-Z_\$][\w\$]*)`)

0 commit comments

Comments
 (0)