Project

General

Profile

Actions

Bug #105974

closed

line breaks in settings.definitions.yaml are ignored

Added by wini2 no-lastname-given 20 days ago. Updated about 12 hours ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2025-01-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It's not possible to add a linebreak according to https://yaml-multiline.info/ and|or https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/CodingGuidelines/CglYaml.html
in my site set settings.definitions.yaml. In other yaml-contexts like form-framework \n is respected.


Files

105974-demo.png (27.5 KB) 105974-demo.png Oliver Hader, 2025-01-22 11:56
site-sets01.jpg (124 KB) site-sets01.jpg Site set with line-breaks wini2 no-lastname-given, 2025-01-23 23:32
Actions #1

Updated by Garvin Hicking 20 days ago

  • Category set to Site Handling, Site Sets & Routing
Actions #2

Updated by Gerrit Code Review 19 days ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87851

Actions #3

Updated by Oliver Hader 19 days ago

In general, the YAML parser supports line breaks, e.g. when wrapped in quotes - e.g. @key: "first\nsecond\nthird".

For site set definitions, those line breaks are however not reflected in the user interface.
I've added a short proof-of-concept change on review.typo3.org for the corresponding web component, now using a new nl2br function to convert newlines to <br>.

This might probably be a new generic nl2br lit directive instead.

Actions #4

Updated by Gerrit Code Review 19 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87851

Actions #5

Updated by Gerrit Code Review 19 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87851

Actions #6

Updated by Oliver Hader 18 days ago

  • Status changed from Under Review to Needs Feedback

The PoC at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87851 showed that there is no YAML parsing issue, but more a representation issue in the browser (since newlines are not automatically represented in HTML).

@Garvin Hicking Mentioned, it could be fixed easily with CSS white-space: pre


@wini2 no-lastname-given Can you please describe where you wanted to use line-breaks in the site sets, or what you're scenario was about? Thanks in advance!

Actions #7

Updated by wini2 no-lastname-given 18 days ago

If a longer description/explanation is needed, line breaks could make it much easier to read. 105974-demo.png is the result I expect.

Actions #8

Updated by Gerrit Code Review 8 days ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87988

Actions #9

Updated by Garvin Hicking 8 days ago

  • Status changed from Under Review to Needs Feedback

I've now pushed patch the following patch that sets 'white-space: pre'. Please check if that would help you:

https://review.typo3.org/c/Packages/TYPO3.CMS/+/87988
[BUGFIX] Allow display of white-space in site settings descriptions

Actions #10

Updated by Garvin Hicking 8 days ago

  • Status changed from Needs Feedback to Under Review
Actions #11

Updated by wini2 no-lastname-given 5 days ago

Thanks for your response.
I've tested linebreaks in settings.definitions.yaml

ubsp.templateRootPath: 
label: 'Templates'
category: ubsp.templates
type: string
default: 'EXT:ubsp/Resources/Private/ContentElements/Templates/'
description: "Setting für eigenes SP. Weitere s. settings.yaml Some text.\nWith newline.\n\t\tTabbed."

works fine. But for categories it doesn't work.

categories:
  ubsp:
    label: 'ub sitepackage'
    description: "Some text.\nWith newline.\n\t\tTabbed." 
    ... 
Actions #12

Updated by Garvin Hicking 5 days ago

Thanks! Yes indeed, this needs to be set for each field where linebreaks could occur. Any chance you know of other fields like this?

Actions #13

Updated by wini2 no-lastname-given 5 days ago

With a slightly additon in the typo3/sysext/backend/Resources/Public/Css/backend.css it should work.

.settings-category p {color: purple; white-space:pre;}

Actions #14

Updated by wini2 no-lastname-given 5 days ago

I don't know if white-space: pre is responsible that I get a horizontal scrollbar. Maybe

white-space: pre-wrap

would be a better choice.

Actions #15

Updated by Garvin Hicking 5 days ago

Very helpful, thanks, I will ammend the patch accordingly

Actions #16

Updated by Gerrit Code Review 5 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87988

Actions #17

Updated by Garvin Hicking 5 days ago

I've updated the patch and commit message, happy if you could check it (and maybe vote on the patch)

Actions #18

Updated by Gerrit Code Review 5 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87988

Actions #19

Updated by Benjamin Kott 5 days ago

Please avoid solutions to this that include CSS od manual parsing.
If we want to extend the capabilities here, we should add Markdown support here with a reasonable subset.

Please see https://quire.getty.edu/docs-v1/fundamentals/ for examples of Markdown in YAML.

Actions #20

Updated by Gerrit Code Review 5 days ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #21

Updated by Gerrit Code Review 4 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #22

Updated by Gerrit Code Review 4 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #23

Updated by Gerrit Code Review 4 days ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #24

Updated by Gerrit Code Review 3 days ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #25

Updated by Gerrit Code Review 3 days ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #26

Updated by Gerrit Code Review 3 days ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #27

Updated by Gerrit Code Review 1 day ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88050

Actions #28

Updated by Gerrit Code Review about 12 hours ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88133

Actions #29

Updated by Benjamin Franzke about 12 hours ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF