Problem/Motivation
When exporting via Views Data Export as CSV with Strip HTML enabled, cell text is truncated if content contains plain-text < / > (e.g. low pressure, <1 MPa).
In CsvEncoder::formatValue() the order is:
Html::decodeEntities($value) — &lt;1 MPa becomes <1 MPa
strip_tags($value) — treats <... as a tag and removes/truncates the rest
Steps to reproduce
- Drupal 10.x,
views_data_export, csv_serialization 4.0.1.
- Create content with HTML body text including e.g.
low pressure, &lt;1 MPa.
- Views display: Data export, format CSV, CSV settings: Strip HTML checked.
- Export and open CSV.
Proposed resolution
Swap order in formatValue():
if ($this->stripTags) {
$value = strip_tags($value);
$value = Html::decodeEntities($value);
}
Strip real HTML tags first, then decode entities so plain </> are preserved.
Comments