mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-08 01:53:25 +02:00
Differentiate between formatted and preview text
This commit is contained in:
@@ -252,7 +252,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||
if (file.exists()) {
|
||||
String html = Helper.readText(file);
|
||||
if (html.toLowerCase(Locale.ROOT).contains(find)) {
|
||||
String text = HtmlHelper.getText(html);
|
||||
String text = HtmlHelper.getPreviewText(html);
|
||||
if (text.toLowerCase(Locale.ROOT).contains(find))
|
||||
match.matched = true;
|
||||
}
|
||||
|
||||
@@ -3213,7 +3213,7 @@ class Core {
|
||||
String text = null;
|
||||
try {
|
||||
String html = Helper.readText(message.getFile(context));
|
||||
text = HtmlHelper.getText(html);
|
||||
text = HtmlHelper.getPreviewText(html);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
text = message.preview;
|
||||
|
||||
@@ -1070,6 +1070,10 @@ public class HtmlHelper {
|
||||
return preview;
|
||||
}
|
||||
|
||||
static String getPreviewText(String html) {
|
||||
return JsoupEx.parse(html).text();
|
||||
}
|
||||
|
||||
static String getText(String html) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class WorkerFts extends Worker {
|
||||
|
||||
File file = message.getFile(getApplicationContext());
|
||||
String html = Helper.readText(file);
|
||||
String text = HtmlHelper.getText(html);
|
||||
String text = HtmlHelper.getPreviewText(html);
|
||||
try {
|
||||
sdb.beginTransaction();
|
||||
FtsDbHelper.insert(sdb, message, text);
|
||||
|
||||
Reference in New Issue
Block a user