Auto Self Close Tag
A VSCode extension that simplifies working with HTML self-closing tags and removes closing tags when converting to self-closing.
Demo
Features
This extension provides two key features to make working with self-closing HTML tags smoother:
Auto-Convert Regular Tags to Self-Closing Tags
When you add a slash to convert a regular HTML tag to a self-closing tag, the extension automatically removes the corresponding closing tag.
Example:
<p></p>
When you add a slash after the "p" to make it <p/, the extension automatically detects and removes the closing tag:
<p/>
Auto-Complete Self-Closing Tag Syntax
When typing a self-closing tag, the extension automatically adds the closing angle bracket.
Example:
<img
When you type a slash to make it <img /, the extension automatically adds the closing angle bracket:
<img/>
Supported Languages
- HTML
- XML
- PHP
- JavaScript (JSX)
- TypeScript (TSX)
Installation
- Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Search for "Auto Self Close Tag"
- Click Install
Usage
The extension works automatically when editing supported file types. No configuration needed!
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature )
- Commit your changes (
git commit -m 'Add some amazing feature' )
- Push to the branch (
git push origin feature/amazing-feature )
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
| |