Add a non-breaking space at the end of the personalization tag

When a text block contains only a personalization tag, WP renderer removes the block.
Adding a non-breaking space is a workaround solving this issue.
[MAILPOET-6396]
This commit is contained in:
Jan Lysý
2025-01-06 17:06:46 +01:00
committed by Oluwaseun Olorunsola
parent 9fdcf2f4b3
commit 70e6a9328b

View File

@ -97,7 +97,7 @@ function PersonalizationTagsButton( { contentRef }: Props ) {
let richTextValue = create( { html: blockContent } );
richTextValue = insert(
richTextValue,
create( { html: `<!--${ tag }-->` } ),
create( { html: `<!--${ tag }-->&nbsp;` } ), // Add a non-breaking space to avoid an issue when WP renderer removes blog containing only a comment
start,
end
);