A suggestion for epubs: in lvstsheet.cpp LVCssSelectorRule::check try this one:
case cssrt_class: // E.class
#if 0 //[RP]
// todo
{
lString16 val = node->getAttributeValue(attr_class);
val.lowercase();
// if ( val.length() != _value.length() )
// return false;
//CRLog::trace("attr_class: %s %s", LCSTR(val), LCSTR(_value) );
return val == _value;
}
break;
#else
{ // class="one two three"
lString16 val = node->getAttributeValue(attr_class);
val.lowercase();
lString16 first, second;
lString16 splitme = val;
// convert tabs to blanks
lString16 tabulator("\t");
while (splitme.replace( tabulator, cs16(" "))) {
;
}
//while not a single class name
while (splitme.split2(cs16(" "), first, second)) {
// if the are multiple blanks between class names
second.trim(); // trims spaces at beginning and end of string
if (first == _value || second == _value) // equals one of the parts
return true;
else
splitme = second; // see if the second part can be split
}
// if cannot be split or does not match any part
return val == _value;
}
break;
#endif
|