fix
Browse files129 unmodified lines130131132133134135136137138139129 unmodified lines# Fallback: support === index.html === format if any file is missingif not (files['index.html'] and files['index.js'] and files['style.css']):# Use regex to extract sections - match === markers with optional whitespace and newlines# Made [\r\n]+ optional with * instead of + to handle cases where content follows immediatelyhtml_fallback = re.search(r'===\s*index\.html\s*===\s*[\r\n]*([\s\S]+?)(?=\n===|$)', code, re.IGNORECASE)js_fallback = re.search(r'===\s*index\.js\s*===\s*[\r\n]*([\s\S]+?)(?=\n===|$)', code, re.IGNORECASE)css_fallback = re.search(r'===\s*style\.css\s*===\s*[\r\n]*([\s\S]+?)(?=\n===|$)', code, re.IGNORECASE)print(f"[Parser] Fallback extraction - HTML found: {bool(html_fallback)}, JS found: {bool(js_fallback)}, CSS found: {bool(css_fallback)}")129 unmodified lines130131132133134135136137138139129 unmodified lines# Fallback: support === index.html === format if any file is missingif not (files['index.html'] and files['index.js'] and files['style.css']):# Use regex to extract sections - match === markers with optional whitespace and newlines# Fixed lookahead to allow any whitespace (not just \n) before next === markerhtml_fallback = re.search(r'===\s*index\.html\s*===\s*[\r\n]*([\s\S]+?)(?=\s*===\s*index\.js\s*===|$)', code, re.IGNORECASE)js_fallback = re.search(r'===\s*index\.js\s*===\s*[\r\n]*([\s\S]+?)(?=\s*===\s*style\.css\s*===|$)', code, re.IGNORECASE)css_fallback = re.search(r'===\s*style\.css\s*===\s*[\r\n]*([\s\S]+?)$', code, re.IGNORECASE)print(f"[Parser] Fallback extraction - HTML found: {bool(html_fallback)}, JS found: {bool(js_fallback)}, CSS found: {bool(css_fallback)}")
backend_parsers.py+4-4