View Single Post
Old 08-08-2014, 10:18 AM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Question correct interpretation of <br> with centred text

i was reading a book in my latest tablet app- moon reader pro - & it seemed to be mangling some two-line headings-
So I returned to sigil to check book view & code:
in sigil book view, and in ADE, I see 2 lines of header, both centred,
and the code has the two lines wrapped in spans, with a
<br />
used to force a line break.
it is yucky code as there's also some a href stuff linking back to toc

but my issues is that moon reader displays it as
line 1 centred
line 2 left

whereas every other epub reader I try displays both lines as centered

so is there a relevant spec as to how it should render, or is there ambiguity

and - the hard sigil question now... is there an alternative to <br> that can be simply regexed into place that will keep both lines centered.

i kludged it with mutliple regex passes but ended up with wide spacing between the 2 header lines, as I forced them to be 2 x header lines of same class.

I can see this being an issue with other books in this reader. e.g. there could be a verse of poetry- cenetred - with <br> used to force the line breaks, and that would be even more of a pain to tweak if it came out as only the 1st line centered, the rest not centered

here's a snippet of the original crap (retail) code ( it's a Stephen King book
)
Code:
<body class="text" id="text">
  <div class="chapter" id="TOC-6">
    <h2 class="chp"><a href="../Text/wizardandglass_con01.html#TOCC-6"><span class="chapnum"><b>CHAPTER I</b></span><br />
    B<span class="largecap">ENEATH THE</span> D<span class="largecap">EMON</span> M<span class="largecap">OON</span> (I)</a></h2>

    <h3 class="sub1"><b>1</b></h3>

Last edited by cybmole; 08-08-2014 at 10:23 AM.
cybmole is offline   Reply With Quote