diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc index e7e293917..1bfff345b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3474,7 +3474,11 @@ function drupal_pre_render_styles($elements) { $import_batch = array_slice($import, 0, 31); $import = array_slice($import, 31); $element = $style_element_defaults; - $element['#value'] = implode("\n", $import_batch); + // This simplifies the JavaScript regex, allowing each line + // (separated by \n) to be treated as a completely different string. + // This means that we can use ^ and $ on one line at a time, and not + // worry about style tags since they'll never match the regex. + $element['#value'] = "\n" . implode("\n", $import_batch) . "\n"; $element['#attributes']['media'] = $group['media']; $element['#browsers'] = $group['browsers']; $elements[] = $element; |