View Single Post
Old 02-23-2010, 03:04 PM   #211
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by Hamlet53 View Post
One thing I've noticed about the use of TIDY; it often 'corrects' code in a way I don't want. My HTML editor of choice is HTML Kit and this includes TIDY as a plugin. However, it produces a side-by-side comparison of original code and corrected with changes highlighted.
When it works, Tidy usually doesn't mess up your code too much. It is also used internally in Sigil to keep the HTML source of the book in an XML format; this makes it much easier (and faster) to manipulate the source. You can just use an XML tool.

In 0.2.0, a lot of the performance gains have come from removing the regex manipulations and using an XML tool (like QDom). This along with the multi-threading work make opening and closing the TOC editor instantaneous in 0.2.0. It was very slow in 0.1.x. This could not have been achieved without something to keep the source as XML.

And since the user can always edit the source in the Code View, there has to some automated tool to correct any mistakes the user may have made that change the XML validity of the document. Sadly, the only error-correcting parser that can handle really ugly HTML and is in C or C++ is HTML Tidy.

So both of us will just have to live with it.
Valloric is offline