05-01-2011, 12:10 PM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
different epub interpretations of <br> ?
i noice that when I add line space via sigil book view
e.g. I change from line 1 followed by line 2 so that I see line 1 followed by line 2 then sigil does this by adding code like <p class="whatever"><br /></p> where the class is whatever is in use on other paragraphs. This "works" i.e. looks good in sigil book view, & also looks good in calibre epub viewer, but when I send to my Sony 650, the line spaces are not visible .i.e. the Sony apparently completely ignores lines like <p class="whatever"><br /></p> IS the epub spec ambiguous, or is Sony e-reader software out of lien with rest of world ? PS I Know that I am supposed to use proper styles & not lazy <br /> tags, but if I am in book view and want to separate blocks of text , e.g. to put extra space around a quote or a subheading, it would be good to be able to just hit ENTER & get consistent results on all devices. I have had to resort to explicity hitting space bar a couple of times, not just hitting enter, to get results I want. is especially annoying with sigil's indent feature,which adds blockquote tags, as Sony seems to also ignore any blockquote styling & shows the indented text with zero top & bottom margin - stripping any <br> lines. Last edited by cybmole; 05-01-2011 at 12:14 PM. |
05-01-2011, 12:22 PM | #2 |
Guru
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
|
Yes, hitting enter in book view is useless. You have to use proper styles in code view. Hitting the space bar a couple of times and then enter will probably result in
<p class="whatever"> </p> which is not a good idea either. An interesting addition to Sigil would be the ability to specify the behaviour when the enter key is pressed in book view. Options could be: (1) Add class xxx to next paragraph (2) Add class xxx to previous paragraph (3) Add empty paragraph (4) Add br tag. |
05-01-2011, 12:41 PM | #3 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
IT may offend purists but it does the job alright though in that I get consistency between PC viewers & e-readers. - a blank line in all cases - whereas the simple <br> is treated inconsistently. |
|
05-01-2011, 03:42 PM | #4 |
Wizard
Posts: 4,332
Karma: 4000000
Join Date: Oct 2008
Location: Paris
Device: Cybooks; Sony PRS-T1
|
As far as I know :
<p>whatever</p> <p>whatever</p> will get : watever watever There already is a space between paragraphs, Unless the css says otherwise.... And the <br/> is a simple ligne change. ie <p>whatever<br/> whatever</p> <p>whatever<br/> whatever</p> will get: whatever whatever whatever whatever Last edited by EowynCarter; 05-01-2011 at 03:45 PM. |
05-01-2011, 03:51 PM | #5 |
Guru
Posts: 688
Karma: 150000
Join Date: Feb 2010
Device: none
|
I know I'll get my share of flames from purists as well, (and rightly so) but I use a "belt-and-suspenders" approach, inserting this into the html:
<p class="linebreak" > <br /></p> along with a CSS rule like: p.linebreak { line-height: 0.8em; margin-top: 0.0em; margin-bottom: 0.0em; } or similar. This seems to work for all the readers I normally check. |
05-02-2011, 12:39 AM | #6 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
my gripe was that it is a chore to have to switch to code view & type all that stuff, if all I want to do is insert a blank line while in book view!
and my question was: is there an epub spec that says what a reader should do when it encounters a line containing only a <br /> tag - as Sony's interpretation seems to be to ignore it ? i.e. to ignore <p><br /><p> constructs Last edited by cybmole; 05-02-2011 at 12:41 AM. |
05-02-2011, 01:16 AM | #7 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
05-02-2011, 04:17 AM | #8 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
"User agents should ignore empty P elements." and previously: "authors should not rely on user agents to render white space immediately after a start tag or immediately before an end tag" where "whitespace" means (in XHTML) any of: SPACE (& #x0020;) HORIZONTAL TABULATION (	) CARRIAGE RETURN (
) LINE FEED (
) Thus, <p> </p> is not empty, because is not whitespace and it's not ignored. And in my interpretation, <p><br/><p> is not empty either, but it seems the Adobe engine (used by the Sony reader) is removing the <br/> immediately preceding </p> (I think it was mentioned in another thread), so the paragraph becomes empty. My advice, as expected is to convert all <p><br/><p> into an appropriate class for the following (or previous) paragraph. |
|
05-02-2011, 05:31 AM | #9 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
As Jellby says -
Search for <p><br /></p> Replace with <p> </p> |
05-02-2011, 05:44 AM | #10 | |
Wizard
Posts: 4,332
Karma: 4000000
Join Date: Oct 2008
Location: Paris
Device: Cybooks; Sony PRS-T1
|
Quote:
<p>text</p> <p><br/></p> <p>text2</p> should give text text2 Or, admiting the <p><br/></p> is totally ignored, text text2 |
|
05-02-2011, 07:24 AM | #11 |
Well trained by Cats
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
My 2cents. I can see the ADE interpretation.
<br /> is a tag, not a printing character like to force an extra new line, they should be used in pairs |
05-03-2011, 12:59 PM | #12 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
so is it that no software is right or wrong - it's all grey area interpretation ?
is sigil "right" to create an unpaired <br /> tag when you press enter in book mode ? any mileage in calling that a bug / request a different treatment via future enhancements ? the ability to insert line space in book view is IMHO, a needed feature. Many free book sources e.g. William Gibson sprawl trilogy - which is free online in HTML - have had all soft break / scene break code stripped and so to improve an ebook/epub version & make it like the printed copy there is a frequent need to insert blank lines when proofing. The "obvious" way to do that quickly is to scan the text in book view, with a purchased or library paper book copy in one hand, & hit enter whenever a soft break needs adding.;but because of the <br> issues above, it is clearly not the "best" way. I only realised that this simple fix was not working, for Sony reader, after fixing up 2 entire books that way ! |
05-03-2011, 03:22 PM | #13 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
For I a blank line I always use <p> </p>. Some purist will say that I have to solve it with margins for specific paragraphs, but it works.
|
05-03-2011, 04:52 PM | #14 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
As far as the purist approach of adding margins to specific paragraphs goes, it's fine for general margins across the doc, but for softbreaks specifically I think <p> </p> is the best solution. This is primarily because of the possibility of format shifting. <p> </p> is MUCH less likely to be ignored during a format shift, whereas css margins get lost in translation all the time.
@cybmole, <br /> does not need to be paired with a closing tag because it's self closing. Stick with book view and just hit enter followed by spacebar for soft breaks and you'll get <p> </p>, which a fair number of users in this thread are voting for. <br /> is really meant to be used inside a populated paragraph, not an empty one, at least in the epub world where Adobe is currently the primary renderer on readers. |
05-04-2011, 01:05 AM | #15 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
I see the possible logic of why the <br> by itself is ignored. the sony ( = ADE?) engine maybe thinks to itself. "I'm being told to start a new line, but I am already at the start of a line so I don't need to do anything here " a future enhancement could be to have an "add scene break" icon alongside the bold, italic etc buttons, for use in book mode. the next nice-to-have would then be a remove indent button for use on the line following the scene break. those 2 features would make book mode a more powerful WYSIWYG tool |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Reading epub on viewer inexplicably changes the time stamp of epub | greenapple | Library Management | 20 | 03-19-2011 10:18 PM |
epub, ePub, EPUB, warum blos ePub? | flowoeB | Lounge | 5 | 11-27-2009 09:37 AM |
Bad movie interpretations | pshrynk | Lounge | 69 | 06-27-2008 10:06 AM |