Skip to content

Can we have data-wp-html directive similar to data-wp-text for Interactivity API? #70531

@BhargavBhandari90

Description

@BhargavBhandari90

There is no way to render HTML using Directive?

When we use Interactivity API for block and if we want to display html content inside data-wp-each we can't display our html contnet using any directive.

In the below sample code, I want to render html for class="step-text"

Sample code:

<template data-wp-each--step="context.steps">
	<div class="step-card" data-wp-bind--data-index="context.step.index" data-wp-class--show="state.showStep">
		<div data-wp-text="context.step.step"></div>
		<div class="step-text" data-wp-text="context.step.description"></div>
	</div>
</template> 

What is your proposed solution?

We should have directive like data-wp-html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions