Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-23-2014, 03:12 PM   #16
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Jellby View Post
Hmm... I can't see why, but I have no Sigil to test.
Ah, well, I sort of see why... Isn't there an option for "greedy" matching?



Yes, that's fine, and that should be catched by my previous suggestion (with multiline enabled), but this is not:

line-height:1.3
line-height:1.2em;

I understood that you were testing with that.
i am testing with what is in post #3
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
cybmole is offline   Reply With Quote
Old 02-23-2014, 03:34 PM   #17
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: 31,079
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by cybmole View Post
i am testing with what is in post #3
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
While 2 occurrences is sloppy coding, it is not disallowed. The last one prevails.

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.
theducks is offline   Reply With Quote
Advert
Old 02-23-2014, 04:46 PM   #18
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,550
Karma: 19500001
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.
Jellby is offline   Reply With Quote
Old 02-24-2014, 01:27 AM   #19
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Jellby View Post
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.
ok fair cop - as I said, this was an artificial test file & I could not be bothered to do this

.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
cybmole is offline   Reply With Quote
Old 02-24-2014, 03:25 AM   #20
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,550
Karma: 19500001
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
Jellby is offline   Reply With Quote
Advert
Old 02-24-2014, 05:33 AM   #21
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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]*;?
it will match all the entries in post 3
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.
Perkin is offline   Reply With Quote
Old 02-24-2014, 07:56 AM   #22
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Perkin View Post
Give this a try
Code:
line-height:[^;}\r\n]*;?
it will match all the entries in post 3
would also catch a few where the units are spaced from the amount : 1.2 em
thanks - can you explain the construction/how it works please, it's a bit hard to puzzle out.
cybmole is offline   Reply With Quote
Old 02-24-2014, 08:17 AM   #23
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Perkin View Post
Give this a try
Code:
line-height:[^;}\r\n]*;?
it will match all the entries in post 3
would also catch a few where the units are spaced from the amount : 1.2 em
sorry - a late disqualification for that one

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
cybmole is offline   Reply With Quote
Old 02-24-2014, 08:28 AM   #24
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: 28,590
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by cybmole View Post
sorry - a late disqualification for that one

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
Uncheck the "Minimal Match" box.
DiapDealer is offline   Reply With Quote
Old 02-24-2014, 08:38 AM   #25
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by DiapDealer View Post
Uncheck the "Minimal Match" box.
disqualification reversed on appeal

i wonder if any of the other entires work better with that minimal box unticked ?
cybmole is offline   Reply With Quote
Old 02-24-2014, 09:57 AM   #26
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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:
Originally Posted by cybmole View Post
thanks - can you explain the construction/how it works please, it's a bit hard to puzzle out.
Searches for
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.
Perkin is offline   Reply With Quote
Old 02-24-2014, 10:36 AM   #27
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,550
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Perkin View Post
Give this a try
Code:
line-height:[^;}\r\n]*;?
it will match all the entries in post 3
But it will also match any other "line-height", won't it? I thought that was not the idea.

Quote:
Originally Posted by cybmole View Post
i wonder if any of the other entires work better with that minimal box unticked ?
I already hinted that:

Quote:
Originally Posted by Jellby View Post
Isn't there an option for "greedy" matching?
greedy matching = minimal match unchecked
Jellby is offline   Reply With Quote
Old 02-24-2014, 10:56 AM   #28
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
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.
cybmole is offline   Reply With Quote
Old 02-24-2014, 10:58 AM   #29
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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:
Originally Posted by Jellby View Post
But it will also match any other "line-height", won't it? I thought that was not the idea.
On re-reading the OP I think you're right, the desired effect is any line-height that is between 1 and 2 em's

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*
or just the entry (not line-break as well)
Code:
line-height\s*:\s*1(\.\d+)?\s*(em)?\s*;?(?=\n|\r)

Last edited by Perkin; 02-24-2014 at 11:01 AM.
Perkin is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 02:24 PM.


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