diff --git a/plugins/views_data_export_plugin_style_export_csv.inc b/plugins/views_data_export_plugin_style_export_csv.inc index 85a8e0d..8e4038c 100644 --- a/plugins/views_data_export_plugin_style_export_csv.inc +++ b/plugins/views_data_export_plugin_style_export_csv.inc @@ -44,12 +44,15 @@ class views_data_export_plugin_style_export_csv extends views_data_export_plugin 'default' => TRUE, 'translatable' => FALSE, ); + $options['keep_html'] = array( + 'default' => FALSE, + 'translatable' => FALSE, + ); $options['encoding'] = array( 'default' => '', 'translatable' => FALSE, ); - return $options; } @@ -101,6 +104,11 @@ class views_data_export_plugin_style_export_csv extends views_data_export_plugin '#title' => t('Make first row a list of column headers.'), '#default_value' => !empty($this->options['header']), ); + $form['keep_html'] = array( + '#type' => 'checkbox', + '#default_value' => !empty($this->options['keep_html']), + '#title' => t('Keep HTML tags.'), + ); $form['encoding'] = array( '#type' => 'select', '#default_value' => !empty($this->options['encoding']) ? $this->options['encoding'] : '', diff --git a/theme/views_data_export.theme.inc b/theme/views_data_export.theme.inc index 1a4f7d3..e2b85c1 100644 --- a/theme/views_data_export.theme.inc +++ b/theme/views_data_export.theme.inc @@ -148,7 +148,8 @@ function template_preprocess_views_data_export_csv_body(&$vars) { // Format row values. foreach ($vars['themed_rows'] as $i => $values) { foreach ($values as $j => $value) { - $output = decode_entities(strip_tags($value)); + $value = (empty($vars['options']['keep_html'])) ? strip_tags($value) : $value; + $output = decode_entities($value); if (!empty($vars['options']['trim'])) { $output = trim($output); }