Mobileread
Something in Sigil disturbs my tags
#1  steve100 10-16-2020, 06:26 PM
I'm using Sigil 1.3.0 on Windows 7 64-bit.

I seem to be going around in circles with formatting my book.
My book is organized so that it has every chapter in it's own file.
I have a working CSS stylesheet.
I am working partially from NotJohn's guide.
I have gone through and re-edited issues in all the files countless times.

But something keeps messing with my html tags.

For instance, certain operations will change:
<p><h2 id="sigil_toc_id_1">ABOUT THIS BOOK</h2></p>

to invalidate my <p> tags:
<p></p>
<h2 id="sigil_toc_id_1">ABOUT THIS BOOK</h2>
<p></p>

But whatever is doing it, does this to all the p-tags in all the chapters when it happens.
So if I have <p class="first">here's some text</p>
It will get changed to <p class="first"></p>here's some text<p></p>

I have found a few things that change all my tags:
Generate Table of Contents
Open Files
Saving Files
changing the name of a chapter file in the Book Browser column

When this happens, I have to go through my book, line by line, and change back all my tags to the way I had them. Have I missed something obvious?
Reply 

#2  theducks 10-16-2020, 06:48 PM
You can't nest a H2 inside a P

Your invalid code may have confused things when trying to clean the errors
Reply 

#3  steve100 10-16-2020, 06:58 PM
OK, Thanks. I didn't know that. I wonder if I have that kind of error elsewhere? <stray thought>
Reply 

#4  hobnail 10-16-2020, 08:55 PM
Quote steve100
OK, Thanks. I didn't know that. I wonder if I have that kind of error elsewhere? <stray thought>
No doubt you do.

This is the plugin that I use to verify my epubs. The title might be misleading; the plugin/wrapper may be considered simple but epubcheck is rigorous.

https://www.mobileread.com/forums/sh...d.php?t=248186

It may seem intimidating but it's not, but you'll first need to install Java before you can install that plugin. Installing Java these days is pretty brainless. Java SE 15 seems to be the latest and greatest.
Reply 

#5  DNSB 10-17-2020, 01:05 AM
Probably more than you want to know but you can check the HTML spec at whatwg.org, specifically 3.2.5.2.5 Phrasing content which lists those elements that can be used inside <p>...</p>.

Interesting reading if taken with a large supply of your favourite source of caffeine.
Reply 

#6  exaltedwombat 10-18-2020, 08:57 AM
What were the <p> tags around your <h2> ones intended to do? Extra spacing? You can get the same result by modifying the effect of 'h2' in your stylesheet.
Reply 

#7  hobnail 10-18-2020, 01:22 PM
Quote exaltedwombat
What were the <p> tags around your <h2> ones intended to do? Extra spacing? You can get the same result by modifying the effect of 'h2' in your stylesheet.
Sometimes having h tags grouped together can be helpful. In that case a div can be used around them. I use the <header> tag for that grouping but that doesn't fly with epub 2 which is one of the reasons I use epub 3. For the sake of consistency (one of the hobgoblins of my small mind) I use header tags around single h tags as well as multiple ones.
Reply 

#8  AlanHK 10-19-2020, 09:57 AM
Quote hobnail
I use the <header> tag for that grouping but that doesn't fly with epub 2 which is one of the reasons I use epub 3. For the sake of consistency (one of the hobgoblins of my small mind) I use header tags around single h tags as well as multiple ones.
If you run kindlegen on an epub3 with <header> tags, you get a warning for each.

Warning(inputpreprocessor):W29004: Forcefully closed opened Tag: <header>

Not a fatal error, and you get a usable file. But still annoying.
I don't know what would happen if you submitted such a file to Amazon to publish.

Since my small mind cannot see any need for these tags, I delete them on sight, the files are still good per epubcheck.
Reply 

#9  hobnail 10-19-2020, 05:28 PM
Quote AlanHK
Since my small mind cannot see any need for these tags, I delete them on sight, the files are still good per epubcheck.
Kill those pesky buggers!
Reply 

#10  Notjohn 10-20-2020, 02:16 PM
Quote
I use the <header> tag for that grouping but that doesn't fly with epub 2 which is one of the reasons I use epub 3
Interesting, thanks!

Quote
I don't know what would happen if you submitted such a file to Amazon to publish.
Amazon/KDP doesn't use epubcheck, so if looks okay in the KDP online preview, I suspect it would sail through.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register