diff --git a/lib/src/editor/editor_component/service/shortcuts/character/format_single_character/format_single_character.dart b/lib/src/editor/editor_component/service/shortcuts/character/format_single_character/format_single_character.dart index 0f65c4f14..43e2b7be8 100644 --- a/lib/src/editor/editor_component/service/shortcuts/character/format_single_character/format_single_character.dart +++ b/lib/src/editor/editor_component/service/shortcuts/character/format_single_character/format_single_character.dart @@ -56,6 +56,11 @@ bool handleFormatByWrappingWithSingleCharacter({ return false; } + // 5. If the text inbetween is empty (continuous) + if (plainText.substring(lastCharIndex + 1, selection.end.offset).isEmpty) { + return false; + } + // Before deletion we need to insert the character in question so that undo manager // will undo only the style applied and keep the character. final insertion = editorState.transaction