devxlogo

Pretty Print Your HTML and ASP Code for Visitors

Pretty Print Your HTML and ASP Code for Visitors

If you are preparing Active Server Pages code for printing or for code review it helps to make the script as tidy as possible. A free utility called HTML Tidy from http://www.w3.org/People/Raggett/tidy/ does an excellent job of putting HTML in order. Unfortunately, Tidy doesn’t preserve ASP code. For example, it converts ASP delimiters into HTML escape codes so that HTML Tidy runs from the command prompt. Here’s the contents of a batch file called dotidy.bat:

 tidy -i -m -u -raw -f  errors.txt -wrap 200 %1

Call the batch file by passing the filename to it as in:

 dotidy.bat myfile.asp

I’ve asked the author of HTML Tidy to add a switch that protects ASP code. Perhaps additional requests at his Web page will provide an incentive.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist