kirby icon indicating copy to clipboard operation
kirby copied to clipboard

Pages field preview: ampersand shows as `&`

Open fabianmichael opened this issue 3 years ago • 2 comments

Description

It seems, like HTML special characters are escaped twice in the field previews used by structure fields.

Expected behavior
The page title should appear as entered by the user

Screenshots
Bildschirmfoto 2021-12-13 um 18 53 54

To reproduce

Select any page with an ampersand in its title in a structure field that has a pages field.

Your setup

Kirby Version: 3.6.1.1

Your system

  • Device: MacBook Pro 14"
  • OS: macOS 12.0.1
  • Browser: Firefox
  • Version: 95.0

fabianmichael avatar Dec 13 '21 17:12 fabianmichael

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Aug 10 '22 10:08 stale[bot]

Summary

The issue arises as the data shown here originates in Panel\Model::pickerData() where text gets escapes via ->toSafeString(). While the preview bubble itself would be safe without escaping (as escaping is already handled by Vue, the data from ::pickerData() also gets shown in other places in k-item, which does output them via v-html. So we cannot simply get rid of the escaping.

Solution

I think we can only safely tackle this once we separate the picker fields' value from the data to show k-items in the dialog.

distantnative avatar Sep 15 '22 21:09 distantnative

Same issue here on structure field :-( issue

sbstnslg avatar Aug 19 '23 17:08 sbstnslg