-
Notifications
You must be signed in to change notification settings - Fork 70
Quotation marks in text field inside structure are removed. #892
Comments
That's probably due to how textarea fields are saved in the content file for a structure field. I'd just save the text without any quotation marks and add them via CSS. That gives you absolute control over how your quotes look and you do not depend on the quotes actually being added to the text. |
Yea, I debugged that far... and I found a workaround. but this should still be flagged. In case somebody in the future wants to make something where there are quotation marks only around certain texts... |
I tracked down where this comes from with the following reduced test case: $data = [
[
'name' => 'Lorem ipsum',
'quote' => 'Dolor sit amet.'
],
[
'name' => 'Consetetur sadipscing',
'quote' => '"Elitr sed diam nonumy eirmod."'
]
];
echo Spyc::YAMLDump($data, false, false, true); It is basically exactly what Kirby does internally, but only using the Spyc YAML library that Kirby uses. The result is: -
name: Lorem ipsum
quote: Dolor sit amet.
-
name: Consetetur sadipscing
quote: "Elitr sed diam nonumy eirmod." Note the quotes in the result. If we run that through the YAML parser again, we get this:
Note that the quotes are missing. The reason is that those quotes have a meaning in YAML as delimiters for string values. I think this is a bug in Spyc, see mustangostang/spyc#53. |
Thanks for taking it up with them. |
I'm making a bootstrap carousel with quotes.
In the panel it looks like a structure with a textarea field for the quote and a text field.
But when I save a a text between quotation marks, the quotation sometimes marks just disappear - not in all cases, but in some of them. the only one I could say happens regularly is the first entry.
The text was updated successfully, but these errors were encountered: