![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Files with <a...></a> Tags Don't Beautify
I run into this quite a bit. It might be with other tags as well, but it looks like files that include <a...></a> tags don't want to beautify (Tools > Beautify All Files) in the Editor. Nothing seems to happen when I try. Is that expected behavior?
The following is a Scrambled version of part of a book I'm messing with right now. Supposedly, it's been beautified. But, the heading and paragraph don't even get indented. Just removing the leading <a> tag pair lets the indentations happen. Code:
<a id="GBS.0245.01"></a> <section class="aboutauthorpage"> <h2><span epub:type="pagebreak" id="pg_2" title="2"></span>Zqpsi zhs Cn*jmxp</h2> <p class="center"><img src="../images/epub_Scalzi_2016_no_cr_fmt.jpeg" alt="Photo of John Scalzi" class="imgsetwidth"/><a id="GBS.0245.02"></a></p> <p><a href="http://us.macmillan.com/author/johnscalzi?utm_source=ebook&utm_medium=adcard&utm_term=ebookreaders&utm_content=johnscalzi_authorpage_macdotcom&utm_campaign=9780765388926"><span class="smallcaps">Yxty Tojzak</span></a> pf evu xd okf moam nae*k*qhk vzs di*uaticmp BC ik*wwauq vo yywwat xh thk qgvi dncwuj. Vzs ilz*nbrajs xcl*efmk*jyg oy*wqa, <i>Bmc Aab’v Bgl</i>, qir rgx dco*ijqq sqf*wson’e Ndoo Z. Zdjg*hdun Elzvn cym Lnvn Ktj Ncsmze. Lxj <i>Hkx Zqfo Krbbk</i> jibv*bacwssn bs*dyzsn <i>Wjx Wzrf Ebpmjq; Qgxyr Pw*piwv; Ark*ffrsmi</i>, gkyxt bct 5372’y Ybsv Bvofl isp Sbsk Uaise; wnk <i>Ctkm Xo</i>. Ql*cy*gzqy nsiv lhb uoehbm wmnc qcap, <i>Izen*idyk</i> (<a href="http://whatever.scalzi.com">mpan*mctr.vdbmmh.rnn</a><a id="GBS.0245.03"></a>), pgi oqeb sdgcnr oyr hwi scvom Kvbh Icaphd. Bk taobr ps Wfbk mtnf qfy sqoy anj upaco*ywl. Ysw tda gcno mh ckz bzekb jn*saewk <a href="http://us.macmillan.com/authoralerts?authorName=johnscalzi&authorRefId=1351591&utm_source=ebook&utm_medium=adcard&utm_term=ebookreaders&utm_content=johnscalzi_authoralertsignup_macdotcom&utm_campaign=9780765388926">beci</a>.</p> <a id="GBS.0246.01"></a><a id="GBS.0246.02"></a> </section> </body> |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
I think <a> tags are supposed to be enclosed in a block tag, e.g. <p> or <div>. Correcting them will probably make Beautify work properly. I've often seen "detached" <span> tags similarly misused in epubs.
In your particular example those Google Books epub <a> tags are usually worthless (IMO) so just removing them will also make the Beautify problem go away. ![]() |
![]() |
![]() |
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
I'd been wondering what those "GBS..." tags were. Yes. A Google Books book. I'll probably just delete the lot of them. But, this happens in quite a few books where they're just trying to put in dead-tree page numbers. I also see them with simple non-page number ids: <a id="frontmatter"> or something. Again, with these GBS ids, I'll probably just trash them. For the others, I try to preserve them. If I'm lucky, I can just do a regex search/replace and move the id into a <section> or <h#> tag. But, sometimes, those already contain another id and I don't know what to do with those.
I can't find anything about anchor elements (<a> tags) having to be enclosed in a block-type tag anywhere. AFAICT, the spec doesn't talk about it and the examples don't indicate one way or another. But, neither Calibre's Check Book tool or EPubCheck have any problem with them that way. It's just odd that the Beautify tool just seems to do nothing with pages that start out like that if the checking tools don't see anything wrong. |
![]() |
![]() |
![]() |
#4 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,064
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() If it ain't a block tag, then it needs to be in one. ![]() (and yes, you are not the only one seein' Naked anchors. There is a ton of bad/messy code and it ain't all from indies.) |
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,188
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Use the modify epub plugin to remove the google play page maps. see screenshot.
bernie Quote:
|
|
![]() |
![]() |
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
I've removed those GBS anchors without problem.
I'll also note that the <div> and <figure> tag also suffer the same lack of Beautification if there's an <a></a> tag in there with an image (I usually see it between the <div> or <figure> start tag and the <img> start tag it contains. For instance: Code:
<div id="fig_1"><a></a><img src="../images/00005.jpeg" alt="Thror's Map" class="imgfull"/></div> Last edited by enuddleyarbl; 03-09-2023 at 07:05 PM. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Beautify is very conservative in what it will beautify because in general changing white-space in an HTML file is not safe, it can change rendered appearance.
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
It doesn't work. I tried it yesterday with an eBook from Google Play Books. I've reported it this morning. I hope it can be fixed easily.
Last edited by JSWolf; 03-10-2023 at 05:10 AM. |
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
I tend to stay out of conversations about HTML/CSS "best practice" which seem to quickly escalate into a thread more suited to MR's "Politics & Religion". ![]() |
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,188
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
|
![]() |
![]() |
![]() |
#12 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,188
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
It works. I do not know what you are doing that is incorrect.
bernie |
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@gbm and @JSWolf,
I don't use Modify Epub anymore but I took a quick look at the plugin code. I think the problem may be that the plugin is currently only looking for GBS anchors in their self-closing form Code:
<a id="GBS..."/> Code:
<a id="GBS..."></a> Last edited by jackie_w; 03-10-2023 at 10:55 AM. Reason: ETA |
![]() |
![]() |
![]() |
#15 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,763
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
beautify files icon | rjwse@aol.com | Editor | 2 | 03-26-2021 04:00 PM |
Problem with setting "Beautify individual files automatically when they are opened"? | Capricorn | Editor | 3 | 03-17-2020 07:40 AM |
Completion popup - fix all html/beautify all files | retiredbiker | Editor | 7 | 08-30-2018 01:44 AM |
Kindle files and tags | Care | Calibre | 5 | 12-09-2010 08:17 PM |
Break tags don't work in epub conversions | Amalthia | Calibre | 0 | 04-06-2010 01:07 PM |