Auto link before search highlighting

pull/194/merge
M66B 3 years ago
parent 180d270239
commit c64b7e78b7

@ -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);
}

@ -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);

@ -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() {

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

Loading…
Cancel
Save