mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-20 10:55:29 +00:00
Auto link before search highlighting
This commit is contained in:
parent
180d270239
commit
c64b7e78b7
4 changed files with 3 additions and 5 deletions
|
@ -270,6 +270,7 @@ public class ActivityEML extends ActivityBase {
|
||||||
String html = result.parts.getHtml(context);
|
String html = result.parts.getHtml(context);
|
||||||
if (html != null) {
|
if (html != null) {
|
||||||
Document parsed = JsoupEx.parse(html);
|
Document parsed = JsoupEx.parse(html);
|
||||||
|
HtmlHelper.autoLink(parsed);
|
||||||
Document document = HtmlHelper.sanitizeView(context, parsed, false);
|
Document document = HtmlHelper.sanitizeView(context, parsed, false);
|
||||||
result.body = HtmlHelper.fromDocument(context, document, null, null);
|
result.body = HtmlHelper.fromDocument(context, document, null, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2549,6 +2549,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
|
|
||||||
HtmlHelper.cleanup(document);
|
HtmlHelper.cleanup(document);
|
||||||
HtmlHelper.removeRelativeLinks(document);
|
HtmlHelper.removeRelativeLinks(document);
|
||||||
|
HtmlHelper.autoLink(document);
|
||||||
|
|
||||||
if (message.ui_found && found && !TextUtils.isEmpty(searched))
|
if (message.ui_found && found && !TextUtils.isEmpty(searched))
|
||||||
HtmlHelper.highlightSearched(context, document, searched);
|
HtmlHelper.highlightSearched(context, document, searched);
|
||||||
|
@ -2600,7 +2601,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
.appendElement("em")
|
.appendElement("em")
|
||||||
.text(context.getString(R.string.title_truncated));
|
.text(context.getString(R.string.title_truncated));
|
||||||
|
|
||||||
HtmlHelper.autoLink(document);
|
|
||||||
HtmlHelper.guessSchemes(document);
|
HtmlHelper.guessSchemes(document);
|
||||||
|
|
||||||
boolean overview_mode = prefs.getBoolean("overview_mode", false);
|
boolean overview_mode = prefs.getBoolean("overview_mode", false);
|
||||||
|
|
|
@ -6275,6 +6275,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
Spanned spannedRef = null;
|
Spanned spannedRef = null;
|
||||||
if (!ref.isEmpty()) {
|
if (!ref.isEmpty()) {
|
||||||
Document dref = JsoupEx.parse(ref.outerHtml());
|
Document dref = JsoupEx.parse(ref.outerHtml());
|
||||||
|
HtmlHelper.autoLink(dref);
|
||||||
Document quote = HtmlHelper.sanitizeView(context, dref, show_images);
|
Document quote = HtmlHelper.sanitizeView(context, dref, show_images);
|
||||||
spannedRef = HtmlHelper.fromDocument(context, quote,
|
spannedRef = HtmlHelper.fromDocument(context, quote,
|
||||||
new Html.ImageGetter() {
|
new Html.ImageGetter() {
|
||||||
|
|
|
@ -1241,10 +1241,6 @@ public class HtmlHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Autolink
|
|
||||||
if (view)
|
|
||||||
autoLink(document);
|
|
||||||
|
|
||||||
// Selective new lines
|
// Selective new lines
|
||||||
for (Element div : document.select("div"))
|
for (Element div : document.select("div"))
|
||||||
div.tagName("span");
|
div.tagName("span");
|
||||||
|
|
Loading…
Add table
Reference in a new issue