A paragraph with a line break
- HTML to format
- <p>Line<br>break</p>
- Indent with
- 2 spaces
Result Formatted HTML: <p>
Line
<br>
break
</p>
Lines: 5
Elements: 2
Deepest nesting: 1
Comments: 0
Input length (characters): 20
Output length (characters): 30
- Split the input into 5 tokens: tags, comments, declarations and text.
- Placed each token on its own line, indented 2 spaces per nesting level; an element holding only text stays on one line.
- Void elements such as br and img do not open a level; pre and textarea contents are kept exactly as written.
The br tag is a void element, so it sits on its own line at the same depth as the text around it instead of indenting what follows.