MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / formatHtml

Function formatHtml

lib/html.js:308–333  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

306}
307
308async 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
335export { scanForErrorMessages, removeNonInteractiveElements, splitByChunks, minifyHtml, simplifyHtmlElement, formatHtml, cleanHtml, isTrashClass }

Callers 2

captureSnapshotFunction · 0.90
html_test.jsFile · 0.90

Calls 2

minifyHtmlFunction · 0.85
cleanHtmlFunction · 0.85

Tested by

no test coverage detected