diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stories/SaveStoryGutenbergBlockUseCase.kt b/WordPress/src/main/java/org/wordpress/android/ui/stories/SaveStoryGutenbergBlockUseCase.kt index dfa8c34ac584..98199da1d2aa 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stories/SaveStoryGutenbergBlockUseCase.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stories/SaveStoryGutenbergBlockUseCase.kt @@ -108,7 +108,7 @@ class SaveStoryGutenbergBlockUseCase @Inject constructor( while (storyBlockStartIndex > -1 && storyBlockStartIndex < content.length) { storyBlockStartIndex = content.indexOf(HEADING_START, storyBlockStartIndex) if (storyBlockStartIndex > -1) { - val storyBlockEndIndex = content.indexOf(HEADING_END, storyBlockStartIndex) + val storyBlockEndIndex = content.indexOf(HEADING_END_NO_NEW_LINE, storyBlockStartIndex) try { val jsonString: String = content.substring( storyBlockStartIndex + HEADING_START.length, @@ -248,6 +248,7 @@ class SaveStoryGutenbergBlockUseCase @Inject constructor( const val TEMPORARY_ID_PREFIX = "tempid-" const val HEADING_START = "\n" + const val HEADING_END_NO_NEW_LINE = " -->" const val DIV_PART = "
\n" const val CLOSING_TAG = "" }