Issue Bug Closed

#105974line breaks in settings.definitions.yaml are ignored

wini2 no-lastname-given 01/21/25, 17:40 updated 12/02/25, 14:26

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.

Reviews 4

Files 2

History 1530

Show 25 earlier messages
  1. Oliver Hader commented and changed attached 105974-demo.png <span data-processor="relativetime" data-value="2025-01-22T11:57:31+00:00" > 01/22/25, 11:57 </span>

    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.

    105974-demo.png

  1. Oliver Hader commented and changed status Under Review Needs Feedback <span data-processor="relativetime" data-value="2025-01-23T15:14:19+00:00" > 01/23/25, 15:14 </span>

    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).

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

    —-

    @wini2 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!

  2. wini2 no-lastname-given commented and changed attached site-sets01.jpg <span data-processor="relativetime" data-value="2025-01-23T23:37:49+00:00" > 01/23/25, 23:37 </span>

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

  3. Gerrit Code Review pushed patch set 1 for main to change 87988 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2025-02-03T08:16:03+00:00" > 02/03/25, 08:16 </span>

  4. Garvin Hicking commented and changed status Under Review Needs Feedback <span data-processor="relativetime" data-value="2025-02-03T08:16:48+00:00" > 02/03/25, 08:16 </span>

    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

  5. wini2 no-lastname-given commented <span data-processor="relativetime" data-value="2025-02-05T18:03:25+00:00" > 02/05/25, 18:03 </span>

    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."
        ... 
  6. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-02-05T19:23:19+00:00" > 02/05/25, 19:23 </span>

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

  7. wini2 no-lastname-given commented <span data-processor="relativetime" data-value="2025-02-05T21:04:17+00:00" > 02/05/25, 21:04 </span>

    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;}

  8. wini2 no-lastname-given commented <span data-processor="relativetime" data-value="2025-02-05T21:21:22+00:00" > 02/05/25, 21:21 </span>

    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.

  9. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-02-05T21:56:03+00:00" > 02/05/25, 21:56 </span>

    Very helpful, thanks, I will ammend the patch accordingly

  10. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-02-06T07:16:09+00:00" > 02/06/25, 07:16 </span>

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

  11. Benjamin Kott commented <span data-processor="relativetime" data-value="2025-02-06T09:25:05+00:00" > 02/06/25, 09:25 </span>

    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.

  12. Benjamin Franzke commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-02-10T11:35:09+00:00" > 02/10/25, 11:35 </span>

    Applied in changeset commit:2a4e461635b3a90df50f6e19b661af9124ee5605.