I have a background attribute style which should shows
<td style="border: 1pt solid rgb(192, 192, 208); background: none repeat scroll 0% 0% rgb(239, 239, 255); padding: 0.75pt;">
I have add the style to the td and also checked the background and background-color,but it not work. broder and padding style is ok.

CommentFileSizeAuthor
#2 wysiwyg_filter-788508-2.patch1.35 KBmarkus_petrux

Comments

markus_petrux’s picture

Category: support » bug
Status: Active » Needs work

I think the problem is the position of the values in the background property. I've tried moving the color at the beginning and the filter parses it correctly.

The regular expression used to parse these values is located in wysiwyg_filter.inc and looks like this:

  // 'background' property.
  $groups['color']['properties']['background'] = '(?:'.
    $groups['color']['properties']['background-color'] .'?(?:\s*'.
    $groups['color']['properties']['background-image'] .'?(?:\s*'.
    $groups['color']['properties']['background-repeat'] .'?(?:\s*'.
    $groups['color']['properties']['background-attachment'] .'?(?:\s*'.
    $groups['color']['properties']['background-position'] .'?)))))';

This regexp is aimed to expect the values in a particular order, which is probably the fault here.

So we probably need to change this to accept the property values in ANY order?

markus_petrux’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Could you please try replacing the above mentioned lines with:

  $regexp = '(?:'.
    $groups['color']['properties']['background-color'] .'|'.
    $groups['color']['properties']['background-image'] .'|'.
    $groups['color']['properties']['background-repeat'] .'|'.
    $groups['color']['properties']['background-attachment'] .'|'.
    $groups['color']['properties']['background-position'] .')';
  $groups['color']['properties']['background'] = '(?:'. $regexp .')(?:(?:\s+'. $regexp .')+)';

This variant should allow the background property values specified in ANY order.

pengcx’s picture

Problem solved thx :D

pengcx’s picture

Status: Needs review » Fixed
markus_petrux’s picture

Status: Fixed » Reviewed & tested by the community

Thanks for the feedback. I'll commit the patch to CVS later.

markus_petrux’s picture

Title: The <td> background attribute of style , not shows after wysiwyg filter. » Enhance the parser to accept individual values of background style attribute in any order
Status: Reviewed & tested by the community » Fixed

Committed to CVS, and documented with better title.

http://drupal.org/cvs?commit=362954

markus_petrux’s picture

Actually, this bug affects also the combined font attribute. Follow up issue: #789690: Enhance the parser to accept individual values of font style attribute in any order

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.