Problem/Motivation

The "strip tags" option does both decoding entities and stripping tags, but in some cases you may want to decode entities but not run strip_tags on the output.

An example case is where output contains < and > which strip_tags would misinterpret and truncate data, and where the field output is passed through the rendering system and ends up with entities encoded but the exported CSV data should not be HTML encoded.

Steps to reproduce

Create a view with a streaming data export display. Use "CSV streaming Serializer" format with "Strip tags" option selected. Populate data such that one of the fields contains data such as ">10% and <50% completed".

Note that on export, the output from "<" is truncated by strip_tags().

Proposed resolution

Add an option to decode entities without running strip_tags.

User interface changes

Added "Decode HTML entities" option in format settings.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

RSTaylor created an issue. See original summary.

pwolanin’s picture

Status: Active » Needs work

We should make an issue for and add tests

pwolanin’s picture

Version: 8.x-1.x-dev » 2.x-dev

pwolanin’s picture

Status: Needs work » Needs review
heddn’s picture

Status: Needs review » Reviewed & tested by the community

LGTM.

BTW, you include phpstan previous/next and mark them as optional. Something like:

phpstan (next major):
  allow_failure: true
phpstan (previous major):
  allow_failure: true
pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • pwolanin committed 41721c3d on 2.x
    feat: #3426732 Add option to decode HTML entities
    
    By: rstaylor
    By:...

Status: Fixed » Closed (fixed)

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