Skip to content

Html object is escaped when used to output string inside an HTML tag #313

@BernhardBaumrock

Description

@BernhardBaumrock

Bug Description

As discussed in this thread it is not possible to return markup that does not need the |noescape filter when used inside an HTML tag.

Description of the alfred() method: https://github.com/baumrock/RockFrontend/blob/82a6a33592dc0831cd0b435bf94d507e39f7c6ac/RockFrontend.module.php#L200-L222

Expected Behavior

<div {alfred($page)}>some markup</div>

This should add a custom html string like alfred='{some json here}' that is not escaped so that the resulting html can be read by JS

<div alfred='{some json here}'>some markup</div>

Current state

At the moment I have to use the |noescape filter all the time when using alfred():

<div {alfred($page)|noescape}>some markup</div>

PS: Not sure if that is a bug or a feature request, sorry if I picked the wrong one!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions