kirby
kirby copied to clipboard
Pages field preview: ampersand shows as `&`
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
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
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
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.
Same issue here on structure field :-(