Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-03-2015, 07:25 AM   #1
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
How to change CSS to comments but retain original numeric values

Sigil 0.8.7

I mentioned in another thread that I'm cleaning up a public EPUB from another author and commenting out tons of CSS that the reader should handle. One problem is the author (or their editor), changed the background color and line height in the CSS, and I want to use regex to comment them out. I want to change
Code:
line-height: 100%
to
Code:
/* line-height: 100% */
but if the percent is a different number, I want to keep that number. Here's how I did it, it will work with any percent number.

My regex search is: line-height: (\d+)%;?

My regex replace is: /* line-height: \1%; */

'\1' is the place holder for what was found in between (), which was (\d+).

Last edited by crankypants; 11-03-2015 at 08:37 AM.
crankypants is offline   Reply With Quote
Old 11-03-2015, 08:20 AM   #2
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,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
EDIT: Nevermind. I thought there was a question here. but it seems you were just sharing a solution you found to a problem.

Last edited by DiapDealer; 11-03-2015 at 08:37 AM.
DiapDealer is online now   Reply With Quote
Advert
Old 11-03-2015, 08:37 AM   #3
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
Not sure what you mean @Diapdealer. I had a typo in my "Replace" area which was missing the ending comment part '*/'. It's been fixed.
crankypants is offline   Reply With Quote
Old 11-03-2015, 10:49 AM   #4
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: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
cranky

I have a whole saved clips section devoted to CSS entries

/* \1 */ is one

if a clip has a Replace with captured, it will include the selection

Clips can be inserted into either the search or replace boxes in S&R if you choose it from the toolbar or clip editor (right click menu does not work for S&R boxes) Sometimes I build terms from snippets
theducks is offline   Reply With Quote
Reply

Tags
comments, regex


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Font-Weight Property Values??? soloist66 Conversion 8 06-16-2013 09:08 PM
How to retain original filename? tinear Library Management 2 03-09-2013 12:23 PM
Is there a way to get Calibre to retain "!important" in a css? PatNY Calibre 1 01-06-2011 12:31 PM
Changing original font css in ePub jlbfoot Sony Reader 4 12-28-2010 12:07 PM
Tinkering With Coolreader CSS (and Some Original Writing For Yew) ThomasMcKean Astak EZReader 20 05-11-2010 10:42 AM


All times are GMT -4. The time now is 04:40 PM.


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