Merge pull request #3145 from pangeachat/3135-cant-select-words

chore: exclude reply content from HTML token search
pull/2245/head
ggurdin 5 months ago committed by GitHub
commit b7bb862b71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -185,6 +185,23 @@ class HtmlMessage extends StatelessWidget {
result.add(html.substring(lastEnd)); // Remaining text after last tag
}
final replyTagIndex = result.indexWhere(
(string) => string.contains('<mx-reply>'),
);
if (replyTagIndex != -1) {
final closingReplyTagIndex = result.indexWhere(
(string) => string.contains('</mx-reply>'),
replyTagIndex,
);
if (closingReplyTagIndex != -1) {
result.replaceRange(
replyTagIndex,
closingReplyTagIndex + 1,
[result.sublist(replyTagIndex, closingReplyTagIndex + 1).join()],
);
}
}
for (final PangeaToken token in tokens ?? []) {
final String tokenText = token.text.content;
final substringIndex = result.indexWhere(

Loading…
Cancel
Save