Problem with regex Pattern Matching in Transform Style
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I set up a rule for transforming styles:
font-size matches pattern (.+)\s*rem change the value to \1em
It's in a copyrighted book, so here are excerpts of the css:
span.signUpButton {
width: 160px;
height: 40px;
border-radius: 5px;
background: rgb(106, 115, 123);
padding: 8px 24px;
text-decoration: none;
font-size: 1.2rem;
border: 1px solid #444;
-webkit-
}
became:
.signupbutton {
-webkit-
background: rgb(106, 115, 123);
border-
border-
border-
border-
border-
border-
border-radius: 5px;
border-
border-
border-
border-
border-
border-
font-size:
m;
height: 40px;
padding-bottom: 8px;
padding-left: 24px;
padding-right: 24px;
padding-top: 8px;
text-
width: 160px
}
And, receove this error:
ERROR: CSS: PropertyValue: Missing token for production Choice(ColorValue, Dimension, URIValue, Value, variable, MSValue, CSSCalc, function): (u'CHAR', u'\x1e', 387, 16) [stylesheet.css]
Copying the transformed CSS to a text editor reveals that there is indeed a hidden Unicode character right before the "m".
Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.
status fixreleased