Skip to content

Commit 5752db8

Browse files
committed
remove math.min for nearby line
1 parent cd6e3c3 commit 5752db8

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

frontend/src/components/chat/code-engine/style-update/codeManipulator.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ export class CodeManipulator {
2929
let currentClasses = '';
3030

3131
// Look for className in the component line and nearby lines
32-
for (
33-
let i = componentLineIndex;
34-
i < Math.min(componentLineIndex + 5, lines.length);
35-
i++
36-
) {
32+
for (let i = componentLineIndex; i < lines.length; i++) {
3733
const line = lines[i];
3834
const classNameMatch = line.match(/className\s*=\s*["']([^"']*)["']/);
3935

@@ -861,17 +857,6 @@ export class CodeManipulator {
861857
// Fix arbitrary values in className attributes that might contain problematic characters
862858
line = this.sanitizeArbitraryValuesInClassNames(line);
863859

864-
// Fix missing closing brackets in JSX tags
865-
// Example: <h1 className="class"Text</h1> → <h1 className="class">Text</h1>
866-
/*
867-
const missingClosingBracketRegex =
868-
/(<[a-zA-Z][a-zA-Z0-9]*[^<>]*"[^<>]*)([a-zA-Z0-9])/g;
869-
if (missingClosingBracketRegex.test(line)) {
870-
line = line.replace(missingClosingBracketRegex, '$1>$2');
871-
console.log(`Fixed missing '>' in JSX tag at line ${i + 1}`);
872-
}
873-
*/
874-
875860
// Fix incorrect closing tags
876861
// Look for patterns where closing tag doesn't match opening tag
877862
const openingTagMatch = line.match(/<([a-zA-Z][a-zA-Z0-9]*)[^<>]*>[^<]*/);

0 commit comments

Comments
 (0)