tidy

Tidy causing bad spacing issues (JTidy)

We are using JTidy to clean up some html for sax processing. We've had a lot of trouble around spacing issues as shown in this example: Html <i>stack<span class="bold">overflow</span></i> which outputs "stackoverflow" But... Post JTidy <i>stack <span class="bold">overflow</span></i> which outputs "stack overflow" (note the new ...

Pure Python Tidy-like application/library

Hi, I'm looking for a pure Python library which works like Tidy. Please kindly advise. Thank you. ...

Question about HTMLTidy in Notepad++

How do I make it so that instead of indenting my elements by multiples of 2 spaces (when formatting without wrapping is selected), HTMLTidy indents them by multiples of tabs (4 spaces long but only 1 byte in size)? ...

Question on how to configure HTML Tidy in Notepadd++

How do I make it so that HTMLTidy in Notepad++ only indents when I select "TextFX-->TextFX HTML Tidy-->TiDy Clean Document-nowrap"? All I want it to do is indent tags. But it also changes the Doctype, adds an xmlns attribute to the html tag, changes tags, and probably does some other stuff to the html document. All I need it to do is in...

HTML tidy/cleaning in Ruby 1.9

I'm currently using the RubyTidy Ruby bindings for HTML tidy to make sure HTML I receive is well-formed. Currently this library is the only thing holding me back from getting a Rails application on Ruby 1.9. Are there any alternative libraries out there that will tidy up chunks of HTML on Ruby 1.9? ...

Configuring and Using HTML Tidy

I would like to use Textmate's built-in Tidy (Ctrl+Shift+H) functionality to indent my HTML 'without modifying anything' in the code. I write pretty neat HTML already, I just need Tidy to indent my code with Soft-tabs. Currently it breaks a lot of things and the formatting isn't perfect either. Can someone please write a Tidy config for...

HTML tag replacement regex not quite working correctly

This is a follow up to another question of mine. The solution I found worked great for every one of the test cases I threw at it, until a case showed up that eluded me the first time around. My goal is to reformat improperly formatted tag attributes using regex (I know, probably not a fool-proof method as I'm finding out, but bear with...

How to use libtidy with tidyParseBuffer()?

I'm trying to clean some HTML with libtidy (C language), the problem is: I want to construct a TidyDoc (a tree-like structure) with tidyParseBuffer(). I have no problem with tidyParseFile(); about tidyParseBuffer(): I'm sure I read the file properly and that the TidyBuffer structure I give to tidyParseBuffer() is correctly filled. Any...

How to best use JTidy with a Spring servlet container?

I have a Java servlet container using the Spring Framework. Pages are generated from JSPs using Spring to wire everything up. The resulting HTML sent to the user isn't as, well, tidy as I'd like. I'd like to send the HTML to Tidy right before it's sent to the client browser. I'll set it up to work in development and be turned off in ...

.NET version of HTML Tidy?

Does anyone know if there's a native port of HTML Tidy available for .NET? In Sourceforge, there's a TidyNet project - which hasn't been updated since 2005 and seems like a wrapper only. Java port seems to exist as recent JTidy project. HTML Tidy project page: http://tidy.sourceforge.net/ ...

Using Tidy to clean HTML, HTML content is being changed, encoding problem?

I am fetching HTML from a smarty template and need to clean it (simply want to remove extra whitespace, and format / indent the HTML nicely), I'm using tidy to do something like: $html = $smarty->fetch('foo.tmpl'); $tidy = new tidy; $tidy->parseString($html, array( 'hide-comments' => TRUE, 'output-xhtml' => TRUE, 'indent'...

Tidy.NET for rendering ASP.NET pages (webforms)

I´m using tidy.NET for correcting (indenting) ASP.NET pages, but it creates 2 html tags, one with viewstate and other with rest of page. Could i change this for having only 1 html tag? Thx in advance, ...

Tidying up jQuery

Hi, I have a page which uses a lot of jQuery code but it is becoming unmanageable. I want to be able to tidy it up to place related parts into separate .js files and include them onto the page in a script tag. I seem to be able to do this by creating them as jQuery plugins then by using $(document).*plugin_name();* on the page. Is it...

Prevent tidy from adding html tags

I have a class that generates some html (form elements and table elements), but this class returns all the html in one line. So I am trying to use tidy to beutify the code (indent the code, put line breaks, etc), the only problem I am having is that's also generating the tags I don't want. Here is the code: tidy_parse_string( ...

A command-line HTML pretty-printer: Making messy HTML readable

I'm looking for recommendations for HTML pretty printers which fulfill the following requirements: Takes HTML as input, and then output a nicely formatted/correctly indented but "graphically equivalent" version of the given input HTML. Must support command-line operation. Must be open-source and run under Linux. ...

Is there a utility to tidy VBScript ?

I'm wanting a tool to tidy VBScript code. I'm looking for something to do the same job as perltidy for Perl, or astyle for C++ and Java code. I've looked, but failed to find anything here or via Google. Open Source software would be preferred. Can anyone point me at one please? ...

Eclipse Galileo SQL Editor: is there a code formatter (tidy) function?

I do like the SQL editor now bundled with Eclipse but I can't seem to find a way for it to format my code like eclipse will with my java. Did I miss something, or does anybody have any alternatives? Thanks ====EDIT==== I'd also be happy if there was an alternate plug-in that someone could recommend. ...

HTML Indentation in the mVc World

Here is a question that has been bugging me for a while, nowadays it's considered a good practice to indent HTML code but I've some reservations indenting code in a MVC pattern, here is a (silly) example: HTML Code: <!DOCTYPE html> <html> <head> <title>Testing MVC Indentation</title> </head> <body> <?php View('h1', 'I am a Level 1 He...

Is there an alternative to HTML Tidy?

Hi, I have embedded HTML Tidy in my application to clean incoming HTML. But Tidy has a huge amount of bugs and fixing them directly in the source is my worst nightmare. Tidy source code is an unreadable abomination. Thousand+ line functions, poor variable naming, spaghetti code etc. It's truly horrible. Worse yet, official development ...

Tidy returns empty string

On my local server, this works fine. However, when I try to do this on the production server, the following returns an empty string: $tidy = new tidy(); $tidy->repairString($html); $html has actual HTML content before repairing (I checked), but repairString returns an empty string. Does this indicate a configuration error? Is libtidy ...