Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pages field preview: ampersand shows as & #4041

Closed
fabianmichael opened this issue Dec 13, 2021 · 3 comments · Fixed by #5493
Closed

Pages field preview: ampersand shows as & #4041

fabianmichael opened this issue Dec 13, 2021 · 3 comments · Fixed by #5493
Assignees
Labels
type: bug 🐛 Is a bug; fixes a bug type: regression 🚨 Is a regression between versions
Milestone

Comments

@fabianmichael
Copy link
Contributor

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
@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Dec 19, 2021
@distantnative distantnative changed the title Ampersand in pages field preview shows as & Pages field preview: ampersand shows as & Dec 21, 2021
@distantnative distantnative changed the title Pages field preview: ampersand shows as & Pages field preview: ampersand shows as & Dec 21, 2021
@stale
Copy link

stale bot commented Aug 10, 2022

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 stale bot added the type: stale 💤 Will be closed soon because there was no recent activity label Aug 10, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2022
@distantnative distantnative reopened this Aug 31, 2022
@distantnative distantnative added type: regression 🚨 Is a regression between versions and removed type: stale 💤 Will be closed soon because there was no recent activity labels Aug 31, 2022
@distantnative
Copy link
Member

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.

@sbstnslg
Copy link

Same issue here on structure field :-(
issue

@distantnative distantnative self-assigned this Aug 20, 2023
@distantnative distantnative added this to the 4.0.0-beta.1 milestone Aug 20, 2023
distantnative added a commit that referenced this issue Aug 20, 2023
@distantnative distantnative linked a pull request Aug 20, 2023 that will close this issue
distantnative added a commit that referenced this issue Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug type: regression 🚨 Is a regression between versions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants