This extension mimics the browser's interpretation of the DOM and automatically corrects all inconsistencies such as forgotten tag closures throughout the HTML automatically.
ブラウザのDOM解釈を模倣し、HTML全体のタグの閉じ忘れなどの不整合を自動的に全て自動で修正します。
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Html Normalizer is a VS Code extension that helps you clean up and fix your HTML files with just one click.
If your HTML has missing closing tags, broken structure, or is just a fragment, this tool will automatically correct it for you—just like a web browser would.
Main Features
One-click HTML cleanup: Instantly fixes unclosed tags and messy nesting.
Works with fragments: Even if your HTML is just a snippet, it keeps the structure partial and doesn’t force extra tags.
Browser-like results: Uses the same logic as browsers, so your HTML will behave as expected.
Keeps DOCTYPE: The <!DOCTYPE html> declaration stays untouched.
How to Use
Open your HTML file in VS Code.
Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette.
Type HtmlNormalizer and run the command.
Your HTML will be instantly normalized and cleaned up.
Who is this for?
Anyone who edits HTML in VS Code and wants to avoid manual tag fixing.
Web designers, students, and developers who want browser-compatible HTML.
Change Log
0.9.10
Preserve original newline blocks after <html>, before <body>, and after </body> without compressing internal script/style content.
Add tests for script/style newline preservation, <html>-after newline retention, and flexible whitespace assertions.
0.9.9
Default to fragment serialization for partial HTML: preserves input order, keeps scripts/comments, and avoids adding <html>/<head>/<body> wrappers.
Harden full vs. fragment detection using parser source locations and by ignoring <html inside comments/scripts/styles; case-insensitive HTML tag handling.
Replace fragile regex-based reinsertion with DOM-based serialization; preserve original DOCTYPE.
Add tests (VS Code tests + fast unit tests) covering comments, script strings, tables (<tbody> insertion), nested anchors, and more.
Add error handling with Output Channel messages.
Update docs and packaging ignores (exclude tests, artifacts).
0.9.8
Readmeのバッジエラーの解消
0.9.7
The Readme is now available in both English and Japanese.
0.9.6
Fixed an issue where the format of !DOCTYPE and <html> tags was altered.
0.9.5
Fixed an issue where elements outside the <html> tag, like !DOCTYPE, were being removed.