Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-23-2024, 01:09 PM   #1
vleaf0210
Junior Member
vleaf0210 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2024
Device: none
How do I remove this type of tag?

Example:
Code:
<span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.2.1"> キン、と</span>
Result:
Code:
 キン、と
I want to remove the tag from the code above and keep only the text inside the tag.
I don't know what regex to use for this like pattern... Could you help me?
vleaf0210 is offline   Reply With Quote
Old 03-23-2024, 01:32 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Using the TagMechanic plugin might be the easiest way.

But those span tags do not hurt anything and they really do not need to be removed at all.

Why are you trying to remove them? They were placed there in the kobo version of that book for a reason.
KevinH is offline   Reply With Quote
Advert
Old 03-23-2024, 02:02 PM   #3
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by vleaf0210 View Post
Example:
Code:
<span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.2.1"> キン、と</span>
Result:
Code:
 キン、と
I want to remove the tag from the code above and keep only the text inside the tag.
I don't know what regex to use for this like pattern... Could you help me?
Use calibre and use the Modify ePub plugin to remove the KePub code form your eBooks.

The other solution is to download them as ePub from Kobo you won't have the Kobo code to remove.
JSWolf is offline   Reply With Quote
Old 03-23-2024, 02:06 PM   #4
vleaf0210
Junior Member
vleaf0210 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2024
Device: none
Quote:
Originally Posted by JSWolf View Post
Use calibre and use the Modify ePub plugin to remove the KePub code form your eBooks.

The other solution is to download them as ePub from Kobo you won't have the Kobo code to remove.
Can't you remove this tag with a regex in sigil?
vleaf0210 is offline   Reply With Quote
Old 03-23-2024, 02:38 PM   #5
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
Use calibre and use the Modify ePub plugin to remove the KePub code form your eBooks.

The other solution is to download them as ePub from Kobo you won't have the Kobo code to remove.
Stop it Jon.

They asked in a Sigil Forum, there are ways to do it with Sigil, so start with a Sigil solution or stay out of the conversation.
DiapDealer is offline   Reply With Quote
Advert
Old 03-23-2024, 02:40 PM   #6
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by vleaf0210 View Post
Can't you remove this tag with a regex in sigil?
Regex is never ideal for removing tags from xhtml that can be nested. Like spans.
DiapDealer is offline   Reply With Quote
Old 03-23-2024, 04:15 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
@vleaf0210

As explained, when tags are nested like spans can be, regex can get confused.

That is why I tried to suggest using the TagMechanic plugin may be easier.

I assumed you have a basic understanding of how to find, install, and use Sigil plugins. If not, our Sigil User Guide may help.

if you still want to try with regex, others in the regex thread can certainly provide some help.
KevinH is offline   Reply With Quote
Old 03-23-2024, 05:29 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You could use regex to remove those spans however TagMechanic is a safer solution since it handles nested spans. I would suggest installing TagMechanic, selecting the files you want to remove those spans from and then running TagMechanic. Select the action as delete, the tag name as span, the attribute as class and the Whose value is field as koboSpan. Click on process and then commit and exit. Note that some books will not have the class= and you could try using the id attribute instead. That will require setting the Whose value is field using a regex such as 'kobo\.\d+\.\d+' without the quotes (basically matching any string of the format kobo.number(s).number(s) )
Attached Thumbnails
Click image for larger version

Name:	tagmechanic_kobospan.png
Views:	37
Size:	16.0 KB
ID:	207104   Click image for larger version

Name:	tagmechanic_koboid.png
Views:	34
Size:	16.1 KB
ID:	207105  
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove a 'p' tag with a condition on an inner 'a' tag ? Villard Recipes 2 01-07-2024 08:25 AM
Tag Editor vs search as you type Anyssia Library Management 6 02-06-2022 10:37 AM
Tag Mapper: Remove tag if another specific tag exists? ownedbycats Library Management 2 07-23-2020 10:32 PM
Wondering if there is a way to remove end tag with beginning tag LadyKate Editor 5 06-29-2016 04:32 PM
Composite column problem combining two tag type columns At_Libitum Recipes 1 08-29-2013 12:31 PM


All times are GMT -4. The time now is 10:40 AM.


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