--- name: format-html description: Prettify raw HTML markup provided by the user. Use when the user sends HTML and asks to make it readable, format, indent, or pretty-print it. Output is properly indented (4 spaces), with elements placed on new lines according to nesting depth, and text inside tags kept on a single line. Fix missing or extra opening/closing tags as part of the cleanup. license: MIT metadata: author: Valentin Silyutin version: "1.0.0" --- # HTML Formatting Your task is to format the HTML code provided by the user. Make it clean, valid, and readable, and output **only the resulting HTML code** without any markdown commentary or explanations. ## Formatting Rules 1. **Indentation:** Use **4 spaces** per nesting level. Do not use tabs. 2. **Line Breaks & Nesting:** - Place each block-level element on a new line matching its indentation level. - Void tags (e.g., ``, `
`, ``, ``, ``, `
`, ``) must be placed on their own line when nested inside block elements. - **Inline Elements:** Keep inline elements (e.g., ``, ``, ``, ``, ``) inline with surrounding text to preserve natural whitespace and avoid unintended spacing bugs. 3. **Text Nodes:** Keep regular text inside block tags on a single line — do not wrap based on arbitrary line width. 4. **Preserved Content (`
`, `