11-03-2015, 07:25 AM | #1 |
Hmm.
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% Code:
/* line-height: 100% */ 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. |
11-03-2015, 08:20 AM | #2 |
Grand Sorcerer
Posts: 27,552
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. |
Advert | |
|
11-03-2015, 08:37 AM | #3 |
Hmm.
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.
|
11-03-2015, 10:49 AM | #4 |
Well trained by Cats
Posts: 29,809
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 |
Tags |
comments, regex |
|
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 |