From 6b0efefc8596e92f5968dbb8f1bcb693ae20b155 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Mon, 20 Mar 2023 20:18:49 +0900 Subject: [PATCH] Post Excerpt Block: Fix unexpected commas in certain site languages (#49123) --- packages/block-library/src/post-excerpt/edit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/post-excerpt/edit.js b/packages/block-library/src/post-excerpt/edit.js index 378aa34cd00ba..10e36e267504d 100644 --- a/packages/block-library/src/post-excerpt/edit.js +++ b/packages/block-library/src/post-excerpt/edit.js @@ -156,7 +156,10 @@ export default function PostExcerptEditor( { .split( '', excerptLength + numberOfSpaces ) .join( '' ); } else if ( wordCountType === 'characters_including_spaces' ) { - trimmedExcerpt = rawOrRenderedExcerpt.trim().split( '', excerptLength ); + trimmedExcerpt = rawOrRenderedExcerpt + .trim() + .split( '', excerptLength ) + .join( '' ); } trimmedExcerpt = trimmedExcerpt + '...';