How to use inline html for RichText component
-
I created a Gutenberg block with RichText however html input not working.
This is the code i am using :
attributes:
description: { type: 'string', source: 'html', default: '', }
edit();
<RichText tagName={ "p" } placeholder={ __( "Write a Description" ) } value={ description } multiline={ false } onChange={ onChangeDescription } />
save() :
<RichText.Content tagName="p" value={ description } />
Here if i enter content like below in editor.
Multi platform <span class="text-warning">accessible</span>
This will display raw html(Multi platform <span class=”text-warning”>accessible</span>) in frontend instead of “Multi platform accessible”.
How can i fix this ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to use inline html for RichText component’ is closed to new replies.