Rainie3535 / sigil

Automatically exported from code.google.com/p/sigil
GNU General Public License v3.0
0 stars 0 forks source link

GET RID OF TIDY - PLEASE #899

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. anything Tidy doesn't like
2. deletes files/screws up HTML/ pops up annoying messages/ disables search & 
replace/ disables book preview/ inserts random HTML/ randomly deletes HTML
3. Lose hours of work
...

What is the expected output? What do you see instead?
An example: the source HTML has <div>s in place of <p>s, so I use replace to 
replace all the <div>s with <p>s then go to replace all the </div>s with </p>s. 
Tidy then pops up telling me about malformed HTML and gives me the option of 
automatically repairing (completely fucking up) or manually fixing (line by 
line, tedious) my code and won't let me use replace.

What version of the product are you using? On what operating system?
4 RC1, Windows Vista, Windows 7 (64)

Please provide any additional information below. If your source file
(SGF/EPUB/HTML/etc) is required to fully understand the problem, please
attach it to this issue. Read the ReportingIssues wiki page before
submitting!

Tidy is shit, you have said so yourself. It has got to the stage where its 
ruining an otherwise excellent application. Especially now I'm having to 
generate iBooks specific epubs, with non-standard code. And yes I know iBooks 
is a perversion of the standard and Apple should be damnned in hell for it but 
it's what the customer wants. I can't tell them "Sorry, can't do that, Tidy 
doesn't like it", they just don't understand. Maybe an 'Ignore' option in the 
popup would be a good compromise.

Original issue reported on code.google.com by dkstock...@gmail.com on 9 Jun 2011 at 2:18

GoogleCodeExporter commented 9 years ago
If you want to replace all the <div>s with <p>s, it's easy.

Find: <div([^>]*)>(.*)</div>
Replace: <p\1>\2</p>

... using regex and minimal matching checked. This is how you're supposed to do 
it, and Tidy doesn't say a word.

As for other problems with Tidy, most are problems with your code not being 
well-formed XML and Sigil borking on this. Your code NEEDS to be WF XML for a 
multitude of reasons.

Tidy is usually a good watchdog; it forces you to not do silly things that 
wouldn't work anyway. When it causes grief, it's mostly because your way of 
achieving something could be improved (like this regex example).

With regard to <audio>, <video> etc tags, Tidy will be modified to support them 
in the future.

In general, Tidy *internals* are shit (the code in the library), but it's 
functionality is usually not.

Original comment by Strahinja.Markovic@gmail.com on 13 Jun 2011 at 2:19