![]() |
#1 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,518
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
html tidy
As an experiment, I ran an html book through html tidy online. I got one error and 58 "warnings." The Tidy output had incorporated all the warnings.
I then fixed the one error in the original html file and opened it in Sigil. I saved it as filename.epub and clicked on the Tidy icon. (I am using 5.3.) The "validation results" window at the bottom of the page remained blank. So! 1) Am I correct in assuming that those 58 warnings have all been tidied up without my knowing about it? 2) Is there a chance that Tidy could cause a problem with all that dusting and sweeping behind the scenes? Thanks! |
![]() |
![]() |
![]() |
#2 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
0.5.3 is a bit old, but if I remember correctly the files were always run through Tidy and therefore would have cleaned up certain types of errors. Full HTML Tidy does change your code some, and if you had certain errors in it it could delete parts - though rare. Pretty Print Tidy only formats and fixes basic issues. But you would have to upgrade to the latest version to have the full options on cleaning.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,123
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Turn Tidy off. It messes with the code in a way that's not acceptable.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
|
![]() |
![]() |
![]() |
#5 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Pretty Print Tidy makes very few changes to most code, and is the only way at the moment to get the code formatted nicely automatically. In fact, without Pretty Pretty Tidy (with Clean Source set to off), you would be surprised at the number of books that won't open due to errors. At least that's what happened when the setting was defaulted to off for a version. Its really only HTML Tidy that makes, in my view, too many changes - but still some people prefer it so its available for them. Turning Clean Source completely off is certainly possible - and may be useful for those who know exactly how their code is formatted and don't want any changes, which is why its there too.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Clean Source off is primarily useful to books that don't need Sigil in the first place. LOL
|
![]() |
![]() |
![]() |
#7 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,123
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Most people that do dive into the code don't want Tidy making those styles. https://www.mobileread.com/forums/sho...d.php?t=171931 |
|
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,357
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Last edited by DiapDealer; 01-30-2013 at 07:54 PM. |
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,123
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
So how do you get Tidy to stop making those styles other then turn it off?
|
![]() |
![]() |
![]() |
#10 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Use Pretty Print Tidy.
Tidy is used for both Pretty Print Tidy and HTML Tidy - but in Pretty Print Tidy the Tidy software is only used to do the most basic cleaning. No styles are created with Pretty Print Tidy. |
![]() |
![]() |
![]() |
#11 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Quote:
On a related point, we still badly need a 'save it as it is - I'll fix the errors later' option. Sometimes an editing session has to end NOW. |
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,357
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Allowing to save an epub in an invalid state means Sigil would have to allow opening an epub in an invalid state. How would Sigil possibly know that the error is one that you intentionally saved it with and not one that it would normally fix? The only way I could see that working is by saving it as some other file-type; which is likely to cause confusion when people don't know that they need to open the new error-state-saved project file in order to pick up where they left off. I just don't see it happening.
|
![]() |
![]() |
![]() |
#13 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,357
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not saying it wouldn't be handy. I'm saying I don't think the way Sigil's currently structured will easily allow that kind of "anything goes" save/open scenario. The vast majority of Sigil's feature set is predicated on xhtml being well-formed to begin with.
As I said, the only way I see around it is saving epubs in invalid states as a different filetype. Which while feasible, comes with it's own headaches and considerations. There simply is no "just save it as it is" solution to the problem. Never has been. It would be implemented already if there were. |
![]() |
![]() |
![]() |
#15 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,518
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Back up! Back up! You're arguing in the corner office while out here in the cubicles I don't know what you're talking about.
Which version of Tidy is in Sigil? I went to http://infohound.net/tidy/ and got what I assume is the "full" HTML Tidy that makes changes without being consulted, is that right? I don't find any Pretty Tidy (I get some pictures of tidy places!) but I do find Pretty Print at http://xmlprettyprint.com/ -- is that what I'm after? And are you saying that if I go to another cubicle and use Sigil 6.x, I will have control over what the built-in Tidy does? |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Please turn Tidy off by default | JSWolf | Sigil | 75 | 05-13-2012 11:03 AM |
Tidy use and issue | DaleDe | Sigil | 7 | 06-19-2011 07:22 PM |
Love Sigil, Hate HTML Tidy | Danger | Sigil | 2 | 12-25-2010 08:00 PM |
Sigil, HTML Tidy or PEBCAK? | DTM | Sigil | 6 | 09-26-2010 08:49 PM |
HTML Tidy problems | pdurrant | Sigil | 2 | 04-08-2010 07:38 AM |