(newbie) how to indent a loooong, single-string HTML file

Hello there!

I’m trying to edit some HTML, and unfortunately the system that I copied it from has it in one looooong string of characters. In other words, there are no line breaks! This, despite me saving it as an .HTML file instead of just a .TXT file.

In other words, when I open the .HTML file up in Komodo, it looks like what’s in the THREE LINES immediately below this paragraph (I just copied the first few hundred characters; the actual file is much, much longer than this):

<p style="text-align: left;"><strong>What is the meaning of life?</strong></p><p>If you're not sure, you've come to the right place.</p><div id="belowfold"><div id="wrap"><div id="content"><div id="main"><div id="editable"><div class="mz_component mz_blog mz_editable"><div class="moze-post"><p><span class="moze-huge">Here you'll find a wealth of ideas about

What I’m saying is that when view the .HTML file within Komodo, it just looks like one loooong, multi-coloured string of characters.

So I’m hoping I can get Komodo Editor to display this big long string with different levels of indentation.

How can I do that? I’m a newbie to Komodo and also to working with HTML.

Many thanks for your help!

In Komodo IDE, you can use Format - document using - HTML Document to auto-format it to the multi-line code. If you’re using Edit, you have to use something else, for example: http://www.freeformatter.com/html-formatter.html or http://community.komodoide.com/packages/addons/beautify-js/

2 Likes