Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2022, 08:43 AM   #1
philja
Zealot
philja began at the beginning.
 
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>
The span tags enclose typically no more than the last 9 characters in the paragraph even if this means starting in the middle of a word. The stylesheet shows the no-break class to be:

Code:
span.no-break {text-decoration:none;}
The Content_body class already contains the style parameter ‘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?
philja is offline   Reply With Quote
Old 06-04-2022, 09:40 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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). from the previous screen.
(since many devices already have quirky CSS support, I can't believe this has the desired effect on many devices.
theducks is online now   Reply With Quote
Old 06-04-2022, 09:53 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
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
Turtle91 is offline   Reply With Quote
Old 06-04-2022, 10:02 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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' .
DiapDealer is online now   Reply With Quote
Old 06-04-2022, 10:21 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
Quote:
Originally Posted by DiapDealer View Post
My TagMechanic plugin would remove spans of the class "no-break" easily and quite safely.

Just sayin' .
I use it all the time for this kind of task
theducks is online now   Reply With Quote
Old 06-04-2022, 11:54 AM   #6
philja
Zealot
philja began at the beginning.
 
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.
philja is offline   Reply With Quote
Old 06-04-2022, 01:40 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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?
JSWolf is online now   Reply With Quote
Old 06-04-2022, 02:17 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It's over, Jon.
DiapDealer is online now   Reply With Quote
Old 06-04-2022, 05:11 PM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by theducks View Post
I think it is a (poor?) attempt to prevent Orphan with splits of words (hyphens). from the previous screen.
Yep. Exactly.

Quote:
Originally Posted by DiapDealer View Post
My TagMechanic plugin would remove spans of the class "no-break" easily and quite safely.
Yep. Exactly!

Quote:
Originally Posted by philja View Post
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.
Back in 2021 I wrote this little mini-tutorial on how to download/install Sigil Plugins + set them to buttons.

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>
3. Then delete the span:

Code:
blah blah text.
Quote:
Originally Posted by JSWolf View Post
How was this ePub created? What program(s) were used to before it got into Sigil?
Yeah, I'd be a little interested in that too.

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.
Tex2002ans is offline   Reply With Quote
Old 06-05-2022, 04:06 AM   #10
Ashjuk
Fanatic
Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.Ashjuk ought to be getting tired of karma fortunes by now.
 
Ashjuk's Avatar
 
Posts: 500
Karma: 3498633
Join Date: May 2011
Location: Surrey, UK
Device: Kobo Aura One, Sony PRS 600/650
Quote:
Originally Posted by DiapDealer View Post
My TagMechanic plugin would remove spans of the class "no-break" easily and quite safely.

Just sayin' .
Another vote for TagMechanic

An excellent plugin that I use all the time to 'tidy' epubs.
Ashjuk is offline   Reply With Quote
Old 06-10-2022, 10:07 AM   #11
philja
Zealot
philja began at the beginning.
 
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.
philja is offline   Reply With Quote
Old 06-10-2022, 02:54 PM   #12
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by philja View Post
I'm going to add TagMechanic plugin to my Sigil and have a look at the tutorials mentioned above by @Tex2002ans.


Quote:
Originally Posted by philja View Post
[...] 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.
It's trying to emulate a setting introduced in CSS4 called:

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:
Originally Posted by philja View Post
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).
Another trick I like to do is you can use a simple Search/Replace:

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.
Very helpful when working with lots of junk.

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:
Originally Posted by philja View Post
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.
Yep. Best thing you can do is teach them how to use Styles in Word/LibreOffice.

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.
Tex2002ans is offline   Reply With Quote
Old 06-11-2022, 04:28 PM   #13
philja
Zealot
philja began at the beginning.
 
Posts: 136
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
It's trying to emulate a setting introduced in CSS4 called:

hyphenate-limit-last
Thanks for the heads up on this addition in CSS4. No doubt, I'll find some application for this in future. But in the case of my friend's 'no-break' class, the name of the style is mis-leading because the whole style in the stylesheet was :

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:
Another trick I like to do is you can use a simple Search/Replace:

Search: <span class="no-break">
Replace: <span>
Great idea !!
philja is offline   Reply With Quote
Old 06-11-2022, 04:41 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Another trick I like to do is you can use a simple Search/Replace:

Search: <span class="no-break">
Replace: <span>[/code]

Great idea !!
Not a great idea (IMHO). You then end up with an empty span. You would be best to install TagMechanic and use that to remove the span.

Last edited by JSWolf; 06-11-2022 at 04:44 PM.
JSWolf is online now   Reply With Quote
Old 06-11-2022, 05:18 PM   #15
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
Not a great idea (IMHO). You then end up with an empty span. You would be best to install TagMechanic and use that to remove the span.
I think you missed the part where using TagMechanic to then remove the empty span in question was exactly what was being recommended.
DiapDealer is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 11:13 AM.


MobileRead.com is a privately owned, operated and funded community.