(html)
| 306 | } |
| 307 | |
| 308 | async function formatHtml(html) { |
| 309 | let processed = html |
| 310 | try { |
| 311 | processed = await minifyHtml(processed) |
| 312 | } catch (e) { |
| 313 | // keep raw html if minification fails |
| 314 | } |
| 315 | try { |
| 316 | processed = cleanHtml(processed) |
| 317 | } catch (e) { |
| 318 | // keep minified html if cleaning fails |
| 319 | } |
| 320 | try { |
| 321 | return html_beautify(processed, { |
| 322 | indent_size: 2, |
| 323 | wrap_line_length: 0, |
| 324 | preserve_newlines: false, |
| 325 | end_with_newline: false, |
| 326 | // Force every element onto its own line so line numbers in trace HTML |
| 327 | // map 1:1 to elements (consumed by codeceptq for AI/agent debugging). |
| 328 | inline: [], |
| 329 | }) |
| 330 | } catch (e) { |
| 331 | return processed |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | export { scanForErrorMessages, removeNonInteractiveElements, splitByChunks, minifyHtml, simplifyHtmlElement, formatHtml, cleanHtml, isTrashClass } |
no test coverage detected