View Single Post
Old 03-28-2017, 10:40 PM   #1
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Empty <h1></h1> for ToC target?

(For context, see the thread Non-<hn> tag in TOC: complement to sigil_not_in_toc in the Sigil forum.)

A series of books I’m typesetting each begin with a sort of one-sentence “Once upon a time…” preface. Since the dead-tree version had this formatted similar to headings, I coded the prefaces thus:
Code:
<body>
  <h1 title="Preface">Once there was a world [text elided]…</h1>
</body>
The “title="Preface"” causes Sigil’s ToC generator to give this text the correct entry everywhere. I also have this set as the SRL.

Trouble is, Amazon decided to reset the start-reading location to the next page, Chapter 1, possibly because that had the first text in <p> tags. (I’m guessing; I’ve read the threads about ’zon and SRL voodoo.) It’s also an abuse of <h1> semantics, and I want to format it slightly differently after all, and….

The obvious solution looks like this:
Code:
<body>
  <h1 title="Preface"></h1>
  <p class="preface">Once there was a world [text elided]…</p>
</body>
But (though I could be misunderstanding something) my online reading warns against having empty <h1> tags. So I could write
Code:
<h1 title="Preface">&nbsp;</h1>
or even
Code:
<h1 title="Preface" style="display:none;">&nbsp;</h1>
But before I make myself nuts with work-arounds—is there anything actually wrong with my initial “obvious solution”?
jcsalomon is offline   Reply With Quote