Skip to content

Commit

Permalink
So far so good
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw committed Oct 10, 2024
1 parent a19a31a commit ece3559
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apple/RCTUITextView+Markdown.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ - (void)markdown_textDidChange
{
RCTMarkdownUtils *markdownUtils = [self getMarkdownUtils];
if (markdownUtils != nil) {
NSRange range = self.selectedRange;
NSAttributedString *attributedText = [markdownUtils parseMarkdown:self.attributedText withAttributes:self.defaultTextAttributes];
[self breakUndoCoalescing];
[self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
NSRange range = [self selectedTextRange];
NSAttributedString *attributedString = [markdownUtils parseMarkdown:self.attributedText withAttributes:self.defaultTextAttributes];
[self.textStorage setAttributedString:attributedString ?: [NSAttributedString new]];
[super setSelectedRange:range]; // prevents cursor from jumping at the end when typing in the middle of the text
self.typingAttributes = self.defaultTextAttributes; // removes indent in new line when typing after blockquote
}
Expand Down

0 comments on commit ece3559

Please sign in to comment.