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:

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

    ReplyDelete
  2. 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.

    ReplyDelete
  3. Well done! But who should use it over HTML Tidy?

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

    ReplyDelete
  5. 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! :-)

    ReplyDelete
  6. 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

    ReplyDelete
  7. How about an updated location or version we can download?

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

    ReplyDelete