Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ShortcutsHandler(
val resolvedStyle = resolveStyleName(styleName) ?: continue

s.replace(effectiveTriggerStart, effectiveTriggerStart + trigger.length, "")
view.toggleStyle(resolvedStyle)
view.verifyAndToggleStyle(resolvedStyle)
return
}
}
Expand Down
8 changes: 5 additions & 3 deletions ios/utils/ShortcutsUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,12 @@ + (BOOL)tryHandlingParagraphShortcutsInRange:(NSRange)range

input->blockEmitting = NO;

// Drop conflicting inline typing attrs (e.g. italic) at the cursor before
// applying the codeblock style.
// Drop conflicting inline styles (e.g. italic) across the whole paragraph
// before applying the block style.
NSRange paragraphRange = [input->textView.textStorage.string
paragraphRangeForRange:input->textView.selectedRange];
[StyleUtils handleStyleBlocksAndConflicts:type
range:input->textView.selectedRange
range:paragraphRange
forHost:input];

[ParagraphAttributesUtils resetTypingAttributes:input
Expand Down
Loading