Merge pull request #3145 from pangeachat/3135-cant-select-words
chore: exclude reply content from HTML token search
This commit is contained in:
commit
b7bb862b71
1 changed files with 17 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue