Skip to content

Commit ae8852e

Browse files
committed
fix content
1 parent 87ac990 commit ae8852e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/design-library-list/use-preview-renderer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ export const usePreviewRenderer = (
139139
// The block `wp/site-title` is a dynamic block, so we need to manually replace it for the preview
140140
if ( categoriesRef.current.includes( 'Header' ) ) {
141141
preview = preview.replace( /<!--\s*wp:site-title(?:\s+[^\/]*?)?\/-->/g, siteTitle )
142-
} else if ( categoriesRef.current.includes( 'Tabs' ) ) {
142+
}
143+
if ( categoriesRef.current.includes( 'Tabs' ) ) {
143144
// Add a class for the first tab to be the active tab in the preview
144145
preview = preview.replace( '"stk-block-tabs__tab"', '"stk-block-tabs__tab stk-block-tabs__tab--active"' )
145-
} else if ( categoriesRef.current.includes( 'Post Loop' ) ) {
146+
}
147+
if ( categoriesRef.current.includes( 'Post Loop' ) ) {
146148
const defaultValues = DEFAULT_CONTENT[ 'Post Loop' ]
147149
preview = addPlaceholderForPostsBlock( preview, defaultValues.posts_placeholder, defaultValues )
148150
}
@@ -293,7 +295,7 @@ export const usePreviewRenderer = (
293295
}
294296

295297
// Use contentForInsertion if dev mode is enabled, otherwise use regular content
296-
onClick( designId, category, contentForInsertion || content, blocksForSubstitutionRef.current, selectedPreviewSize )
298+
onClick( designId, category, contentForInsertion || blocks.parsed, blocksForSubstitutionRef.current, selectedPreviewSize )
297299
}
298300

299301
return {

0 commit comments

Comments
 (0)