Auto link before search highlighting

This commit is contained in:
M66B 2021-11-27 15:28:38 +01:00
parent 180d270239
commit c64b7e78b7
4 changed files with 3 additions and 5 deletions

View File

@ -270,6 +270,7 @@ public class ActivityEML extends ActivityBase {
String html = result.parts.getHtml(context);
if (html != null) {
Document parsed = JsoupEx.parse(html);
HtmlHelper.autoLink(parsed);
Document document = HtmlHelper.sanitizeView(context, parsed, false);
result.body = HtmlHelper.fromDocument(context, document, null, null);
}

View File

@ -2549,6 +2549,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
HtmlHelper.cleanup(document);
HtmlHelper.removeRelativeLinks(document);
HtmlHelper.autoLink(document);
if (message.ui_found && found && !TextUtils.isEmpty(searched))
HtmlHelper.highlightSearched(context, document, searched);
@ -2600,7 +2601,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
.appendElement("em")
.text(context.getString(R.string.title_truncated));
HtmlHelper.autoLink(document);
HtmlHelper.guessSchemes(document);
boolean overview_mode = prefs.getBoolean("overview_mode", false);

View File

@ -6275,6 +6275,7 @@ public class FragmentCompose extends FragmentBase {
Spanned spannedRef = null;
if (!ref.isEmpty()) {
Document dref = JsoupEx.parse(ref.outerHtml());
HtmlHelper.autoLink(dref);
Document quote = HtmlHelper.sanitizeView(context, dref, show_images);
spannedRef = HtmlHelper.fromDocument(context, quote,
new Html.ImageGetter() {

View File

@ -1241,10 +1241,6 @@ public class HtmlHelper {
}
}
// Autolink
if (view)
autoLink(document);
// Selective new lines
for (Element div : document.select("div"))
div.tagName("span");