![]() |
#1 |
Zealot
![]() Posts: 136
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Help with strange use of span tags
I’ve been helping an author friend to start using Sigil and explaining basic stuff like what the html tags and CSS styles do. She has asked me to explain the function of a <span> she has found at the end of every text paragraph in her novel.
This is not something that Sigil has introduced into her novel but I didn’t see a forum better positioned to ask this question. A typical text paragraph resembles this example: Code:
<p class="Content_body">Vivamus .... faucibus, ..... est vel u<span class=”no-break”>ltricies.</span></p> Code:
span.no-break {text-decoration:none;} I’m afraid I’ve been unable to see a use for these <span> tags and wonder if anyone can suggest what the designer was trying to do, what eventuality she was trying to guard against? |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,203
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I think it is a (poor?) attempt to prevent Orphan with splits of words (hyphens).
![]() (since many devices already have quirky CSS support, I can't believe this has the desired effect on many devices. |
![]() |
![]() |
![]() |
#3 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,143
Karma: 18843349
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
![]() I concur with theducks... I think it's trying to prevent hyphenation of the last part of the word. Personally I would delete all that as code bloat. Code:
find: <span class=”no-break”>(.*?)</span> replace: \1 |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
My TagMechanic plugin would remove spans of the class "no-break" easily and quite safely.
Just sayin' . ![]() |
![]() |
![]() |
![]() |
#5 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,203
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#6 |
Zealot
![]() Posts: 136
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Thanks everybody for the advice. I thought it most likely to be code bloat. I didn't know about your TagMechanic plugin, DiapDealer.
Whether I can teach my author friend to download and use plugins at this early stage I don't know. We're having a zoom call in a few minutes time so I'll broach the subject. Thanks again, folks. |
![]() |
![]() |
![]() |
#7 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,440
Karma: 134254362
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
How was this ePub created? What program(s) were used to before it got into Sigil?
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It's over, Jon.
|
![]() |
![]() |
![]() |
#9 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
Quote:
And in 2020, I wrote a little one on how to use "TagMechanic" too. It explained how to change <i> -> <em>... but to get rid of your <span class="no-break">, all you have to do is fill in a few other menus: Action Type: Delete Tag name: span Having the attribute: class Whose value is (no quotes): no-break That will: 1. Look for a <span>. 2. With a class called "no-break": Code:
<span class="no-break">blah blah text.</span> Code:
blah blah text. Quote:
If you can ask your author friend, that would be good. If not, whatever. Last edited by Tex2002ans; 06-04-2022 at 05:13 PM. |
||||
![]() |
![]() |
![]() |
#10 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 500
Karma: 3498633
Join Date: May 2011
Location: Surrey, UK
Device: Kobo Aura One, Sony PRS 600/650
|
|
![]() |
![]() |
![]() |
#11 |
Zealot
![]() Posts: 136
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Hi good folks who all piled in with help. A quick update.
For the curious, I see traces in the metadata of Calibre having been involved in the conversion process. When I have tried Calibre for conversion (albeit some years back, before I discovered Sigil), I had to eliminate loads of useless spans but I never came across one like this, systematically cutting off the last 9 characters of every paragraph regardless of word breaks. I think it must be some idea configured into the process by my friend's book designer. I doubt it was aimed at widows and orphans, though, because these had specific parameters defined in the contents paragraphs' CSS in the stylesheet. The good news is that with the Zoom call and a couple of emails, I managed to teach my author friend how to remove those spans with a regex. (including explaining what a regex is and does). Her re-editing of her book is proceeding fine helped by occasional email exchanges and zoom calls. I doubt she will have any need for a book designer for her future books in her series once we get over the plugins hurdle so she can import her Word document into Sigil. I use LibreOffice and the ODTimport plugin with my customised config.xml file which took me a while to sort out for style mapping. I suppose I'll have to go thro the whole thing again for a Word import plugin. ![]() I'm going to add TagMechanic plugin to my Sigil and have a look at the tutorials mentioned above by @Tex2002ans. Thanks again, everyone. |
![]() |
![]() |
![]() |
#12 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
![]() ![]() Quote:
There's also the new: This type of hyphenation functionality has existed in Print for a very long time, but is only just making its way into the latest standards for the web. What must have happened is they were using some sort of program (InDesign?), or some plugin that tried to "hack" a "do not hyphenate in the last word". * * * Speculation: If the Book Designer was working within Word, then there was probably some plugin that ran, trying to hack this functionality into Word using Character Styles. * * * Side Note: The next major version of LibreOffice, 7.4, is going to be introducing this Hyphenation functionality: It'll map to the equivalent CSS4 listed above. Quote:
Search: <span class="no-break"> Replace: <span> Then I use TagMechanic in order to disappear all empty <span>s! Action Type: Delete Tag name: span Having the attribute: No attributes ("naked" tag) That would take you from this: Code:
This is a last <span class="no-break">word</span>. Code:
This is a last <span>word</span>. Code:
This is a last word. I just do lots of simple replaces to get them down to <span>, and then in one swoop, wipe away all the empty ones. ![]() Quote:
Latest project I'm working on with an Editor, taught him Styles—and in less than 20 minutes, he was up and running. 2 weeks later, bam, 2nd book, the DOCX->EPUB conversion is infinitely easier. Now I'm just teaching him little tweaks here and there and tricks to look out for. Last edited by Tex2002ans; 06-10-2022 at 02:56 PM. |
||||
![]() |
![]() |
![]() |
#13 | ||
Zealot
![]() Posts: 136
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
span.no-break { text-decoration:none; } As far as I've understood, text-decoration applies to underlines, overlines, both or none and the main body paragraph styles had none of these which might require canceling. Quote:
|
||
![]() |
![]() |
![]() |
#14 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,440
Karma: 134254362
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
[QUOTE=philja;4229649]
Quote:
Last edited by JSWolf; 06-11-2022 at 04:44 PM. |
|
![]() |
![]() |
![]() |
#15 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Span Span Span Sigil cleaning up indesign | blackest | Sigil | 31 | 12-06-2017 10:16 AM |
Sigil adds spaces between HTML tags, creating strange characters | chezjim | Sigil | 10 | 06-10-2011 04:00 AM |
Strange error managing tags | paulfiera | Calibre | 2 | 02-16-2011 04:42 AM |
Span tags, h1s and emspaces | ConorHughes | ePub | 11 | 09-30-2010 05:00 PM |
PRS-500 Span tags in LRS and LRF files -- do I understand them? | Falstaff | Sony Reader Dev Corner | 2 | 01-31-2007 10:34 AM |