Reputation: 7655
I have an html file (size about 260kb) whose source code is not formatted. i.e., all the tags and all the code of the html file are on one single line. So, on opening it in gedit(or notepad) its impossible to understand its contents. Is is possible to somehow indent it according to tags so that all tags come on different lines and the html code becomes comprehendible. Please help.
Upvotes: 2
Views: 2325
Reputation: 31
Try out purehtml.in. It takes care of indenting for HTML tags, including content within script
and style
tags.
Upvotes: 3
Reputation: 72284
Have you got an IDE to hand? I use Netbeans and generally if I want to format something like that, I'll paste its contents into a new HTML file within Netbeans, hit alt+shift+f to auto-format it, then paste it back to wherever it needs to go.
If not then there's an online tool here.
Upvotes: 2
Reputation: 10377
If it's XHTML, or close to it, you can use these: https://stackoverflow.com/questions/521265/any-online-xml-formatter-or-formatter-in-free-text-editor
Upvotes: 2
Reputation: 30882
You mean aside from tabbing yourself? Try HTML Tidy Online - it has an automatic indentation function.
Upvotes: 4