You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: select whole words when double-click then drag on desktop
Double-clicking a word and holding to drag now extends the selection by
whole words in either direction, keeping the initial word fully selected,
instead of starting a character-level drag from the pointer.
* fix: skip underscore italic for intra-word underscores
Auto-italic on typing a closing underscore now only triggers when the
opening underscore starts a word (at the line start or preceded by
whitespace), so `a_b_c` is no longer italicized. Asterisk formatting is
unaffected.
Copy file name to clipboardExpand all lines: lib/src/editor/editor_component/service/shortcuts/character/format_single_character/format_single_character.dart
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,18 @@ class CheckSingleFormatFormatResult {
116
116
return (false, null);
117
117
}
118
118
119
+
// 6. For underscore italic, only auto-format when the opening underscore
120
+
// starts a word, i.e. it is at the very start or preceded by whitespace.
121
+
// This prevents intra-word underscores like `a_b_c` from being italicized,
122
+
// matching the common markdown behavior (asterisks are unaffected).
Copy file name to clipboardExpand all lines: test/new/service/shortcuts/character_shortcut_events/format_by_wrapping_with_single_char/format_italic_test.dart
+38-6Lines changed: 38 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,9 @@ void main() async {
35
35
36
36
// Before
37
37
// App_Flowy|
38
-
// After
39
-
// App[italic]Flowy
40
-
test('App_Flowy_ to App[italic]Flowy', () async {
38
+
// After (unchanged): the opening underscore is not preceded by
39
+
// whitespace, so an intra-word underscore like `a_b_` is not italicized.
40
+
test('App_Flowy_ does not italicize (intra-word underscore)', () async {
41
41
const text1 ='App';
42
42
const text2 ='Flowy';
43
43
final document =Document.blank().addParagraphs(
@@ -54,11 +54,43 @@ void main() async {
54
54
55
55
final result =await formatUnderscoreToItalic.execute(editorState);
0 commit comments