05-16-2022, 06:44 PM | #1 |
Wizard
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
<wbr>
I have a number of footnotes that contain long URL's. These long URL's force an empty line and extend past the right margin. (image)
I have read both Mozilla and W3Schools and the <wbr> seems pretty easy to use, but both the Calibre Check Book and the EpubCheck plugin flag this use as an error. https://developer.mozilla.org/en-US/...ML/Element/wbr https://www.w3schools.com/tags/tag_wbr.asp This is how I have used it... PHP Code:
Thanks |
05-16-2022, 09:51 PM | #2 |
Sigil Developer
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
|
You could try replacing them with the U+200B ZERO-WIDTH SPACE code point using numeric entities or the character itself.
Also try treating it as a self-closing xhtml element written as <wbr /> |
05-17-2022, 12:39 AM | #3 | ||
Wizard
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
I tried the self-closing tag <wbr/>. The Calibre Check Book is happy with that change, but the EpubCheck plugin still flags errors... Spoiler:
Quote:
|
||
05-17-2022, 09:35 AM | #4 |
Fool
Posts: 377
Karma: 3557934
Join Date: Feb 2003
Device: Kindle Voyage, Kindle PW1, Kobo Glo HD, Nook Glowlight Plus ...
|
Are you sure that inserting a zero-width space won't foul up the URL for someone who tries to copy and paste it? (The <wbr> should disappear from a "text" copy/paste, automatically).
|
05-17-2022, 10:30 AM | #5 |
Sigil Developer
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
|
You could just insert an anchor with href to that external url (with no added zero width spaces) and then use them only in the anchor description.
|
05-17-2022, 10:48 AM | #6 |
Sigil Developer
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Okay tested it. Support for the wbr tag came with html5 so it is part of epub3.
So I tried your test using epub3 and the <wbr /> tag and it nicely passes current EpubCheck. Is there some reason you are still building new epubs as epub 2.0 versions? Epub3 is the current valid epub spec and epub2 is now considered deprecated at best and by many to be obsolete. Epub3 can be made backwards compatible to work with older epub2 only e-readers. It is the leading epub format especially internationally. Epub3 is also a preferred format when converting an epub for the kindle. There seems to be some resistance to moving to epub3 from some people on this site, but epub3 really is the right target to future proof any epub you are making. |
05-17-2022, 07:44 PM | #7 | ||
Wizard
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Quote:
The only reason I am using epub 2.0 is that the ebooks I have here are all epub 2.0 format, so I never really worried about upgrading as they all seem to work quite nicely on my Libra 2. But now I am starting to see limitations, like the <wbr> and <s></s> within a <p> tag (why?), and others I have come across that I don't remember this very minute. Plus with your comments I now think it is time to convert to epub 3, so I'll do just that on my next ebook fix. Is there a handy reference of differences between epub 2 and 3. Yes, I can do a search, but just in case you know of a great and simple reference. I wonder why it is that every book I have is epub2. Maybe its something in my convert settings in Calibre. I'll have a hunt around. Thanks |
||
05-17-2022, 10:53 PM | #8 |
Sigil Developer
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Sigil has a plugin called ePub3-itizer that can convert epub2 epubs to epub3. I am positive Calibre can do exactly the same thing using an internal menu or command but they named it funny, something along the lines of "updating" or "upgrading" your epub. Best ask in the calibre forum and I am sure someone can point you to it.
As the author of Sigil's ePub3-itizer, I would be happy to summarize the conversion process steps if you have questions. Just ask. |
05-18-2022, 12:19 PM | #9 |
the rook, bossing Never.
Posts: 11,080
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
On Calibre, convert to epub and select epub3 in epub Output settings
But I've never found any need for epub3 with ordinary novels. I've never seen <wbr /> A long URL can have short display text, though I prefer the visual text to match the URL. I've also started using QR codes with same URL underneath as my phone works with them on paper, OLED, LCD, eInk in real books, phones, tablets, monitors and eink. I set height to 80px and width to auto for small graphics and width to a suitable % and height to auto for large graphics. |
05-18-2022, 01:33 PM | #10 | |
Resident Curmudgeon
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
05-18-2022, 09:02 PM | #11 | |
Wizard
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
I have found the epub3 setting in Preferences>Output Options>EPUB output>EPUB version and changed it to v3 as default The convert setting is in the Editor: Tools>Upgrade Book Internals. Just about finished reading my current book, so I'll use v3 for the next book I fix. |
|
05-18-2022, 09:08 PM | #12 | |
Wizard
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
From... https://developer.mozilla.org/en-US/...ML/Element/img Use both width and height to set the intrinsic size of the image, allowing it to take up space before it loads, to mitigate content layout shifts. width: The intrinsic width of the image in pixels. Must be an integer without a unit. height: The intrinsic height of the image, in pixels. Must be an integer without a unit. |
|
05-18-2022, 09:50 PM | #13 | |
Grand Sorcerer
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
|
|
05-19-2022, 03:08 AM | #14 |
Wizard
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
05-19-2022, 02:27 PM | #15 |
the rook, bossing Never.
Posts: 11,080
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Yes, I use css, not the HTML. The HTML img tag has the css class. Some examples:
Code:
.pic_half { padding-top: 3pt; height: auto; width: 50% } .pic_small { padding-left: 3pt; padding-right: 3pt; padding-top: 3pt; height: 80px; width: auto } .pic_wide { padding-top: 3pt; height: auto; width: 75% } pic_half and pic_wide are intended for single images per paragraph. I don't put text in the same paragraph. |
Thread Tools | Search this Thread |
|