jaro.io
February 1, 2022, 10:00pm
1
hey everyone
i am getting some weird text formatting with my select field. the title of the queried page is
Kid's Meal Plan
but is being displayed as
Kid's Meal Plan
any idea why this is happening? wanted to ask here and check if it’s something on my end before creating an issue on gh.
my blueprint is fairly simple.
fields:
plan:
label: Plan
type: select
options: query
query: site.find('shop').children
thank you all for your time!
This is known issue and will be fixed soon:
opened 11:03AM - 14 Dec 21 UTC
type: bug 🐛
type: regression 🚨
## Description
I have a tags field that gets its options from a query:
```ya… ml
fields:
bikeManufacturer:
type: tags
max: 1
options: query
query: page.parent.childrenAndDrafts.pluck('bikeManufacturer', ',', true)
required: true
```
When I save a tag featuring an ampersand (e. g. “Riese & Müller“) it gets saved correctly. But when I then go to a sibling page and select that same value from the autocomplete options, it’s getting saved and output as `Riese & Müller`.
**Expected behavior**
The value being saved just like the original.
## To reproduce
1. Create a blueprint using the YAML provided above.
2. Add a page and save a value featuring an ampersand in the tags field.
3. Create a second page and select the previously saved value from the autocomplete options.
4. Create a third page and look at the provided autocomplete options or the value in the just saved txt file of the second page.
## Your setup
**Kirby Version**
3.6.1.1
**Console output**
**Your system (please complete the following information)**
- Device: MacBook Pro
- OS: macOS 12.0.1
- Browser: Google Chrome
- Version: 96.0.4664.110
Maybe related to #4041.
opened 05:58PM - 13 Dec 21 UTC
type: bug 🐛
## 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](https://user-images.githubusercontent.com/395617/145863646-379ff222-dd0a-4537-8bbf-918c456c4368.png)
## 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
1 Like
IMHO, the root cause is that you are not using the correct character. The correct character to indicate a possession (Kid’s Meal Plan) is an apostrophe, not a single quote. Single quote has character code 39, while the apostrophe character has 0146. Note the difference:
Single quote: '
Apostrophe: ’
Since the apostrophe character is usually not on a computers keyboard, we get accustomed ourself to use the single quote as a replacement. The single quote character however has a very special meaning in programming and thus get escaped by escaping libraries like the one Kirby is using.
Try using the apostrophe character, which can usually entered by pressing and holding the Alt-Key and then the sequence 0 1 4 6 on the numeric keypad.
1 Like
jaro.io
February 2, 2022, 10:59am
4
thank you so much for the explanation!