processwire / processwire-issues

ProcessWire issue reports.
45 stars 2 forks source link

Repeater item label text gets truncated after '<' #1932

Open didierbrouwers opened 6 months ago

didierbrouwers commented 6 months ago

Short description of the issue

Repeater item label text is truncated after '<' when '<' is immediately followed by a character.

Expected behavior

The text following '<' should also be shown in the repeater item label.

Actual behavior

Example: 'PO bij 5 tot <9kg' is shown in the repeater label as 'PO bij 5 tot'

Scherm­afbeelding 2024-05-29 om 10 54 50

Steps to reproduce the issue

  1. Create a new Repeater field
  2. Add title field under 'Repeater fields'
  3. Under 'Repeater item labels' enter {title}

Setup/Environment

ryancramerdesign commented 5 months ago

@didierbrouwers It occurs because PHP's strip_tags() function (called by $sanitizer) strips it out, as it apparently looks close enough to the opening of a HTML tag. I'm not really sure of a way around that since it's PHP that's stripping it out rather than ProcessWire. We could remove the strip_tags() call from the Sanitizer::markupToText method, but I think that would likely introduce issues elsewhere.

matjazpotocnik commented 5 months ago

@ryancramerdesign https://github.com/processwire/processwire-issues/issues/1111