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 Johan Cyprich, at 3/24/2007 7:57 PM  

  • Johan - Great idea! Done.

    By Blogger Jonathan, at 3/24/2007 10:00 PM  

  • 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 Johan Cyprich, at 3/25/2007 11:25 AM  

  • Super!

    By Blogger Jonathan, at 3/25/2007 11:23 PM  

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

    By Anonymous nonsequitur, at 3/26/2007 9:35 AM  

  • 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 PM  

  • 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 Oddbjørn, at 1/10/2008 2:26 AM  

  • 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 AM  

  • Anon - You're welcome!

    By Blogger Jonathan, at 9/15/2008 9:01 PM  

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

    By Anonymous Anonymous, at 8/25/2009 3:00 PM  

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

    By Blogger Jonathan, at 8/25/2009 9:51 PM  

Post a Comment

<< Home