File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,17 @@ func stripJSONComments(data []byte) []byte {
136136 continue
137137 }
138138
139+ // Check multi-line comment first - skip all content including quotes
140+ if inMultiLineComment {
141+ if i + 1 < len (content ) && char == '*' && content [i + 1 ] == '/' {
142+ inMultiLineComment = false
143+ i += 2
144+ continue
145+ }
146+ i ++
147+ continue
148+ }
149+
139150 if char == '\\' && inString {
140151 escapeNext = true
141152 result .WriteByte (char )
@@ -156,16 +167,6 @@ func stripJSONComments(data []byte) []byte {
156167 continue
157168 }
158169
159- if inMultiLineComment {
160- if i + 1 < len (content ) && char == '*' && content [i + 1 ] == '/' {
161- inMultiLineComment = false
162- i += 2
163- continue
164- }
165- i ++
166- continue
167- }
168-
169170 if i + 1 < len (content ) && char == '/' && content [i + 1 ] == '/' {
170171 // Single-line comment - skip to end of line
171172 for i < len (content ) && content [i ] != '\n' {
You can’t perform that action at this time.
0 commit comments