ECA Render: Not possible to use markup within render arrays of some elements

Issue information

From user: starlight-sparkle

Related to !559 (merged)

Contribution record

Fork management

Problem/Motivation

There are occasions where it is useful to insert links or other markup into render elements that escape input strings by default. In code, you would do this by wrapping the markup string with a TranslatableMarkup or FormattableMarkup object, but in ECA there is no equivalent.

The ECA Render: Markup action generates a Markup object, but wraps it in a render array, making it impossible to use it inside of other render arrays (as this results in a "0 is not a valid render array key" error).
Even if it does work, it seems to require a very cumbersome approach of constructing a render array one key at a time (using "Token: set value" or "List: add item") just so that the Markup objects can be inserted without getting casted into strings by the yaml parser.

Steps to reproduce

  1. Create a model
  2. Add event "Render: ECA entity"
  3. Add action "Render: build"
  4. Configure action with the following values:
    Value:
    '#theme': 'status_messages'
    '#message_list':
      'status':
        - '<strong>hello!</strong>'

    Interpret above value as YAML format: yes

  5. View a node and observe that the HTML tags in the added element have been escaped.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information