fix
Browse files80 unmodified lines8182838485868714 unmodified lines10210310410510610780 unmodified linesif js_fallback:files['index.js'] = js_fallback.group(1).strip()if css_fallback:files['style.css'] = css_fallback.group(1).strip()# Additional fallback: extract from numbered sections or file headersif not (files['index.html'] and files['index.js'] and files['style.css']):14 unmodified linescontent = re.sub(r'\n```\s*$', '', content)files[file_key] = content.strip()# Normalize transformers.js imports to use v3.8.0 CDNcdn_url = "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.8.0"80 unmodified lines818283848586878889909192939414 unmodified lines10911011111211311411511611711811912012112212312412512612780 unmodified linesif js_fallback:files['index.js'] = js_fallback.group(1).strip()if css_fallback:css_content = css_fallback.group(1).strip()files['style.css'] = css_content# Also normalize HTML to reference style.css (singular)if files['index.html'] and 'styles.css' in files['index.html']:print("[Parser] Normalizing styles.css reference to style.css in HTML")files['index.html'] = files['index.html'].replace('href="styles.css"', 'href="style.css"')files['index.html'] = files['index.html'].replace("href='styles.css'", "href='style.css'")# Additional fallback: extract from numbered sections or file headersif not (files['index.html'] and files['index.js'] and files['style.css']):14 unmodified linescontent = re.sub(r'\n```\s*$', '', content)files[file_key] = content.strip()# Normalize filename references in HTMLif files['index.html'] and files['style.css']:if 'styles.css' in files['index.html']:print("[Parser] Normalizing styles.css reference to style.css in HTML")files['index.html'] = files['index.html'].replace('href="styles.css"', 'href="style.css"')files['index.html'] = files['index.html'].replace("href='styles.css'", "href='style.css'")if files['index.html'] and files['index.js']:if 'app.js' in files['index.html']:print("[Parser] Normalizing app.js reference to index.js in HTML")files['index.html'] = files['index.html'].replace('src="app.js"', 'src="index.js"')files['index.html'] = files['index.html'].replace("src='app.js'", "src='index.js'")# Normalize transformers.js imports to use v3.8.0 CDNcdn_url = "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.8.0"
backend_parsers.py+21-1