Skip to content

Commit

Permalink
BF: Reply of reply with unexpected newlines renders badly
Browse files Browse the repository at this point in the history
element-hq/element-ios/issues/2086

Use a more NSRegularExpression thing to fix it
  • Loading branch information
manuroe committed Oct 31, 2018
1 parent de019bf commit 8e47691
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MatrixSDK/Data/MXRoom.m
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,9 @@ - (NSString*)replyMessageFormattedBodyFromEventToReply:(MXEvent*)eventToReply
if (isSenderMessageAReplyTo)
{
NSError *error = nil;
NSRegularExpression *replyRegex = [NSRegularExpression regularExpressionWithPattern:@"^<mx-reply>[\\s\\S]*</mx-reply>" options:NSRegularExpressionCaseInsensitive error:&error];
NSRegularExpression *replyRegex = [NSRegularExpression regularExpressionWithPattern:@"^<mx-reply>.*</mx-reply>"
options:NSRegularExpressionCaseInsensitive | NSRegularExpressionDotMatchesLineSeparators
error:&error];
NSString *senderMessageFormattedBodyWithoutReply = [replyRegex stringByReplacingMatchesInString:senderMessageFormattedBody options:0 range:NSMakeRange(0, senderMessageFormattedBody.length) withTemplate:@""];

if (error)
Expand Down

0 comments on commit 8e47691

Please sign in to comment.