From 74e384175b25a0a1968c1aa2e75b720b23104727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E7=9F=B3?= Date: Tue, 19 Aug 2025 00:53:52 +0800 Subject: [PATCH] fix(lanzou): correct comment parsing logic in lanzou driver (#9278) - Adjusted logic to skip incrementing index when exiting comments. - Added checks to continue loop if inside a single-line or block comment. - Prevents erroneous parsing and retains intended comment exclusion. --- drivers/lanzou/help.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/lanzou/help.go b/drivers/lanzou/help.go index c3f5c6bb..b3d69006 100644 --- a/drivers/lanzou/help.go +++ b/drivers/lanzou/help.go @@ -94,6 +94,7 @@ func RemoveJSComment(data string) string { } if inComment && v == '*' && i+1 < len(data) && data[i+1] == '/' { inComment = false + i++ continue } if v == '/' && i+1 < len(data) { @@ -108,6 +109,9 @@ func RemoveJSComment(data string) string { continue } } + if inComment || inSingleLineComment { + continue + } result.WriteByte(v) }