Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Saturday, March 24, 2007

Jon's HTML/XML Indenter

Have you ever had a big chunk of messy HTML code that you wished were properly indented? I did, so I wrote a little JavaScript page to clean up the indenting. Presenting: Jon's HTML/XML Indenter.



This just uses a bit of JavaScript to properly indent whatever HTML you paste into the upper box.

11 Comments:

  • This is a useful utility. Could you give the option of specifying the indentation amount? I prefer indenting 2 spaces myself. :)

    By Anonymous Anonymous, at 3/24/2007 7:57 p.m.  

  • Johan - Great idea! Done.

    By Blogger Jonathan, at 3/24/2007 10:00 p.m.  

  • It works great. I use so many web pages that I need to reformat but I don't have hours of time to spare to do that. :) You app will help a great deal. Thanks.

    By Anonymous Anonymous, at 3/25/2007 11:25 a.m.  

  • Super!

    By Blogger Jonathan, at 3/25/2007 11:23 p.m.  

  • Well done! But who should use it over HTML Tidy?

    By Anonymous Anonymous, at 3/26/2007 9:35 a.m.  

  • Tidy's a good choice - but if it changes your code too much, this is a good simple alternative.

    By Blogger Jonathan, at 3/26/2007 10:05 p.m.  

  • Good stuff! I just used this to clean up some xsl-stuff that was getting out of hand.. :)

    Only one feature-request, could you add an option for "Indent only" that disables line-breaking? In its current version your application breaks <xsl:attribute name="font-family">Helvetica</xsl:attribute> into:

    <xsl:attribute name="font-family">
        Helvetica
    </xsl:attribute>

    For my specific purpose it would be better if the application never split or wrapped lines.
    Thanks! :-)

    By Anonymous Anonymous, at 1/10/2008 2:26 a.m.  

  • thank you SO MUCH for creating this! I tried downloading/installed various apps for textpad but your little tool works faster, easier and better!
    many thanks :-D

    By Anonymous Anonymous, at 9/15/2008 11:43 a.m.  

  • Anon - You're welcome!

    By Blogger Jonathan, at 9/15/2008 9:01 p.m.  

  • How about an updated location or version we can download?

    By Anonymous Anonymous, at 8/25/2009 3:00 p.m.  

  • When I get some time I will move this to another server.

    By Blogger Jonathan, at 8/25/2009 9:51 p.m.  

Post a Comment

<< Home