processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

Repeater item label text gets truncated after '<'

Open didierbrouwers opened this issue 1 year ago • 3 comments

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

  • ProcessWire version: 3.0.235
  • PHP version: 8.2.0
  • MySQL version: 5.7.39

didierbrouwers avatar May 29 '24 09:05 didierbrouwers

@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.

ryancramerdesign avatar Jun 07 '24 17:06 ryancramerdesign

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

matjazpotocnik avatar Jun 07 '24 18:06 matjazpotocnik

@didierbrouwers I can't replicate:

image

image

matjazpotocnik avatar Dec 27 '24 19:12 matjazpotocnik