Skip to content

Conversation

@kacperzolkiewski
Copy link
Collaborator

@kacperzolkiewski kacperzolkiewski commented Nov 17, 2025

Summary

Add support for codeblock.

Test Plan

Run Example app and play with codeblock

Screenshots

image

Compatibility

OS Implemented
iOS
Android ✅ (already handled that way)

@kacperzolkiewski kacperzolkiewski marked this pull request as ready for review November 19, 2025 08:38
Copy link
Collaborator

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there!

return NO;
}

+ (BOOL)handleNewlineBackspaceInRange:(NSRange)range replacementText:(NSString *)text input:(id)input {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some verbose comment what that function does and why it needs to run as a last of the callbacks

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add comment with explanation. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 💣

];

return manualLinkRange.length == 0 ? automaticLinkRange : manualLinkRange;
return manualUrl == nil ? automaticLinkRange : manualLinkRange;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of safety I'd also assign automaticUrl to the automatic link range search result and do something like;

Suggested change
return manualUrl == nil ? automaticLinkRange : manualLinkRange;
return
manualLink == nullptr
? automaticLink == nullptr ? NSMakeRange(0,0) : automaticLinkRange
: manualLinkRange;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't happen but if the internals of some iOS function change again it will be less chaotic (:

withInput:(EnrichedTextInputView* _Nonnull)input
inRange:(NSRange)range
withCondition:(BOOL (NS_NOESCAPE ^_Nonnull)(id _Nullable value, NSRange range))condition;
+ (NSArray *_Nonnull)getRangesWithout:(NSArray<NSNumber *> *_Nonnull)types withInput:(EnrichedTextInputView* _Nonnull)input
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please spread the arguments into different lines as in all the other functions?

return occurences;
}

+ (NSArray *_Nonnull)getRangesWithout:(NSArray<NSNumber *> *_Nonnull)types withInput:(EnrichedTextInputView* _Nonnull)input
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguments spreading would also be cool here if we keep it that way in the file. Some objc linter will eventually fix it though so not a big deal 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants