Problem with regex Pattern Matching in Transform Style

Bug #1825764 reported by Jonathan Schmidt
6
This bug affects 1 person
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-box-shadow: 0 0 5px #aaa inset;
}

became:

.signupbutton {
    -webkit-box-shadow: 0 0 5px #aaa inset;
    background: rgb(106, 115, 123);
    border-bottom-color: #444;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    border-left-color: #444;
    border-left-style: solid;
    border-left-width: 1px;
    border-radius: 5px;
    border-right-color: #444;
    border-right-style: solid;
    border-right-width: 1px;
    border-top-color: #444;
    border-top-style: solid;
    border-top-width: 1px;
    font-size:
m;
    height: 40px;
    padding-bottom: 8px;
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 8px;
    text-decoration: none;
    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".

Revision history for this message
Jonathan Schmidt (jonnie-cache) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.