mirror of https://github.com/M66B/FairEmail.git
Differentiate between formatted and preview text
This commit is contained in:
parent
ffebe78922
commit
fe35cc0c1e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue