|  02-23-2014, 03:12 PM | #16 | |
| Wizard            Posts: 3,720 Karma: 1759970 Join Date: Sep 2010 Device: none | Quote: 
 that is a bit false in that you only get one line-height per class definition but I figured it would do for testing regex syntax candidates a genuine real book does not usually mix 1.2em; with 1.2; - it uses one or the other e.g. .PHeading { display: block; font-size: 1.2em; font-weight: bold; line-height: 1.2; text-align: center; text-indent: 0; margin: 1em } .PHeading1 { display: block; font-size: 1.5em; font-weight: bold; line-height: 1.2; text-align: center; text-indent: 0; margin: 1em } i do not know exactly what dialect of regex is used in sigil, sorry | |
|   |   | 
|  02-23-2014, 03:34 PM | #17 | |
| Well trained by Cats            Posts: 31,241 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | Quote: 
 also there is a difference between unit less an with units. from W3C Code: Property Values Value Description normal A normal line height. This is default number A number that will be multiplied with the current font size to set the line height length A fixed line height in px, pt, cm, etc. % A line height in percent of the current font size initial Sets this property to its default value. inherit Inherits this property from its parent element. | |
|   |   | 
|  02-23-2014, 04:46 PM | #18 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			The problem with: line-height:1.3 line-height:1.2em; is not that there are two rules, or that one uses em and the other doesn't. The problem is that there is no semicolon between the two lines, and that's a syntax error. | 
|   |   | 
|  02-24-2014, 01:27 AM | #19 | |
| Wizard            Posts: 3,720 Karma: 1759970 Join Date: Sep 2010 Device: none | Quote: 
 .class 1 { line-height:1.3 } .class2 { line-height:1.2em; etc after seeing that last post, I wonde if putting line-height:initilal at END of CSS would negate all these fixed values anyway - this is for Kobo aura HD where the on-device line spacing options do not work if countermanded by fixed values in book CSS | |
|   |   | 
|  02-24-2014, 03:25 AM | #20 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			"initial" is not listed in the required values of the ePub 2.0.1 spec, try "normal" instead. But I wouldn't be surprised if it does't work    | 
|   |   | 
|  02-24-2014, 05:33 AM | #21 | 
| Guru            Posts: 657 Karma: 64171 Join Date: Sep 2010 Location: Kent, England, Sol 3, ZZ9 plural Z Alpha Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) | 
			
			Give this a try Code: line-height:[^;}\r\n]*;? would also catch a few where the units are spaced from the amount : 1.2 em Last edited by Perkin; 02-24-2014 at 05:38 AM. | 
|   |   | 
|  02-24-2014, 07:56 AM | #22 | 
| Wizard            Posts: 3,720 Karma: 1759970 Join Date: Sep 2010 Device: none | |
|   |   | 
|  02-24-2014, 08:17 AM | #23 | |
| Wizard            Posts: 3,720 Karma: 1759970 Join Date: Sep 2010 Device: none | Quote: 
  I tested it & yes it matches every test line, but only captures up to the 1st colon in each case. line-height:1.2em so if used as a find/replace all pair it would leave lots of stuff behind | |
|   |   | 
|  02-24-2014, 08:28 AM | #24 | |
| Grand Sorcerer            Posts: 28,869 Karma: 207000000 Join Date: Jan 2010 Device: Nexus 7, Kindle Fire HD | Quote: 
   | |
|   |   | 
|  02-24-2014, 08:38 AM | #25 | 
| Wizard            Posts: 3,720 Karma: 1759970 Join Date: Sep 2010 Device: none | |
|   |   | 
|  02-24-2014, 09:57 AM | #26 | |
| Guru            Posts: 657 Karma: 64171 Join Date: Sep 2010 Location: Kent, England, Sol 3, ZZ9 plural Z Alpha Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) | Code: line-height:[^;}\r\n]*;? Quote: 
 line-height: [^;}\r\n] is then any char except ; } or any linebreak char * gives multiple times - should probably really have been + instead the final ;? adds a semi-colon if exists to the match Hope that helps. | |
|   |   | 
|  02-24-2014, 10:36 AM | #27 | ||
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | Quote: 
 Quote: 
 greedy matching = minimal match unchecked | ||
|   |   | 
|  02-24-2014, 10:56 AM | #28 | 
| Wizard            Posts: 3,720 Karma: 1759970 Join Date: Sep 2010 Device: none | 
			
			[QUOTE=Jellby;2771983]But it will also match any other "line-height", won't it? I thought that was not the idea. so long as the ones for narrative text are stripped, then the Kobo HD device options for changing paragraph line spacing should work ok. no real need to also strip large headers etc values for line height - which is why I put a 1.0- 1.99em range idea into the target spec. | 
|   |   | 
|  02-24-2014, 10:58 AM | #29 | |
| Guru            Posts: 657 Karma: 64171 Join Date: Sep 2010 Location: Kent, England, Sol 3, ZZ9 plural Z Alpha Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) | Quote: 
 So a further regex fully expanded which matches each line (and a few further cases) would be Code: line-height\s*:\s*1(\.\d+)?\s*(em)?\s*;?\s* Code: line-height\s*:\s*1(\.\d+)?\s*(em)?\s*;?(?=\n|\r)   Last edited by Perkin; 02-24-2014 at 11:01 AM. | |
|   |   | 
|  | 
| Thread Tools | Search this Thread | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| RegEx question (again) | phossler | Sigil | 12 | 01-20-2013 02:37 PM | 
| A regex question | PatNY | Sigil | 30 | 06-03-2012 02:03 PM | 
| Yet another regex question | Jabby | Sigil | 8 | 01-30-2012 08:41 PM | 
| Regex question and maybe some help | crutledge | Sigil | 9 | 03-10-2011 04:37 PM | 
| Regex Question | Archon | Conversion | 11 | 02-05-2011 10:13 AM |