Skip to content

Commit 7be6369

Browse files
YouAlliotTech
authored andcommitted
fix: correct comment handling in RemoveJSComment function
- Updated the RemoveJSComment function to properly handle the end of multi-line comments by incrementing the index after closing the comment. - Ensured that the function continues to skip characters within comments correctly.
1 parent b45c211 commit 7be6369

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/lanzou/help.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ func RemoveJSComment(data string) string {
9494
}
9595
if inComment && v == '*' && i+1 < len(data) && data[i+1] == '/' {
9696
inComment = false
97+
i++
98+
continue
99+
}
100+
if inComment || inSingleLineComment {
97101
continue
98102
}
99103
if v == '/' && i+1 < len(data) {

0 commit comments

Comments
 (0)