Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 07-05-2016, 07:35 AM   #1
Phoebus
Member
Phoebus began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Aug 2015
Device: Kobo Aura H2O
Problem replacing tags in custom recipe

Hello, I am newish to recipes but got some to work before. However I am having a problem replacing tags in a recipe.

Some sections of text are blue and naturally these don't show up on an eBook reader. I have tried the re.compile function but it doesn't work for me at least how I do it:

I want to swap the tag:

Code:
<span style="color: blue;">
With an italics tag (so either just make it <i> or make the span class italics).

Any advice, I couldn't find anything in search that worked?

PS - I've tried a few variants of this, eg things like

Code:
preprocess_regexps     = [(re.compile(r'<span style="color: blue;">', re.IGNORECASE), '<i>')]
Phoebus is offline   Reply With Quote
Old 07-05-2016, 08:16 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,484
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just add

remove_attributes = ['style']

to your recipe
kovidgoyal is offline   Reply With Quote
Advert
Old 07-05-2016, 10:22 AM   #3
Phoebus
Member
Phoebus began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Aug 2015
Device: Kobo Aura H2O
Thanks, I couldn't get that to work, but it did finally work when I changed the auto cleanup to False then it did.
Phoebus is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom columns from only certain tags areyou Library Management 2 12-15-2012 05:33 AM
Replacing multiple tags over 2 lines kmckinley Sigil 7 09-03-2011 10:34 PM
Replacing tags after using them hiperlink Recipes 2 03-28-2011 10:23 AM
Custom recipe Tags/Category riothamus Recipes 1 11-21-2010 10:42 AM
A problem with custom recipe joshdu1125 Calibre 1 05-03-2009 09:31 PM


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


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