2

Is there a tool that works like Resharper for C# but for HTML/PHP for Windows platform? I often copy some large chunks of code to notepad from CMS and it's often unformatted or very badly formatted so it's hard to read. Would like to have some Resharper CleanUp feature that would format it properly for easy to use/read document.

Example before formatting:

<p>
<a class="hov" href="index.php?option=com_content&amp;view=article&amp;id=15&amp;Itemid=16"><img alt="" src="files/images/buttons/btn_kalkulator1.gif" style="width: 272px; height: 235px;" /></a><a class="hov" href="index.php?option=com_content&amp;view=article&amp;id=10&amp;Itemid=15"><img alt="" src="files/images/buttons/btn_kalkulator2.gif" style="width: 272px; height: 235px;" /></a></p>

Example after formatting

<p>
    <a class="hov" href="index.php?option=com_content&amp;view=article&amp;id=15&amp;Itemid=16">
         <img alt="" src="files/images/buttons/btn_kalkulator1.gif" style="width: 272px; height: 235px;" />
    </a>
    <a class="hov" href="index.php?option=com_content&amp;view=article&amp;id=10&amp;Itemid=15">
         <img alt="" src="files/images/buttons/btn_kalkulator2.gif" style="width: 272px; height: 235px;" />
    </a>
</p>
2
  • I'm not sure whether you can do this inside Notepad. There's PHP environment for Eclipse - there you can definitely do code formatting. Commented Sep 14, 2011 at 16:52
  • I don't need it to be inside Notepad. I just said I u use it (Notepad++ to be exact). I'm just looking for nice and easy solutions to do formatting like in my example or even going further and optimizing HTML like Resharper does it for C#. Commented Sep 14, 2011 at 16:53

3 Answers 3

2

I use JetBrains PHPStorm IDE - lots of format setting for PHP, JS, HTML; quick reformat and other things that are very usable and realy make life easier. I advise you to try it.

Sign up to request clarification or add additional context in comments.

1 Comment

It's doing nice job but it's very limited in configuration. For example it's leaving opening <a> on the end of the line instead of moving it to next line.
2

You might want to try HTML Tidy or online HTML Tidy

I have never used either of them, but that is what I found with a quick google search

Comments

0

The PDT eclipse has a formatting option. I use it a lot, but it's not always a good option because he breaks stuff where I think it's not so handy and easy to read.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.