Make sure marked text is visible

pull/207/head
M66B 3 years ago
parent ea019c5f21
commit 53262f88cd

@ -2780,6 +2780,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (inline || show_images) if (inline || show_images)
HtmlHelper.embedInlineImages(context, message.id, document, show_images); HtmlHelper.embedInlineImages(context, message.id, document, show_images);
HtmlHelper.markText(document);
boolean disable_tracking = prefs.getBoolean("disable_tracking", true); boolean disable_tracking = prefs.getBoolean("disable_tracking", true);
if (disable_tracking) if (disable_tracking)
HtmlHelper.removeTrackingPixels(context, document); HtmlHelper.removeTrackingPixels(context, document);
@ -5114,6 +5116,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
HtmlHelper.autoLink(document); HtmlHelper.autoLink(document);
HtmlHelper.setViewport(document, overview_mode); HtmlHelper.setViewport(document, overview_mode);
HtmlHelper.embedInlineImages(context, message.id, document, true); HtmlHelper.embedInlineImages(context, message.id, document, true);
HtmlHelper.markText(document);
if (disable_tracking) if (disable_tracking)
HtmlHelper.removeTrackingPixels(context, document); HtmlHelper.removeTrackingPixels(context, document);

@ -8921,6 +8921,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (message.isPlainOnly() && monospaced_pre) if (message.isPlainOnly() && monospaced_pre)
HtmlHelper.restorePre(document); HtmlHelper.restorePre(document);
HtmlHelper.markText(document);
HtmlHelper.embedInlineImages(context, id, document, true); HtmlHelper.embedInlineImages(context, id, document, true);
// onPageFinished will not be called if not all images can be loaded // onPageFinished will not be called if not all images can be loaded

@ -2811,6 +2811,15 @@ public class HtmlHelper {
return document; return document;
} }
static Document markText(Document document) {
for (Element mark : document.select("mark")) {
String style = mark.attr("style");
mark.attr("style", mergeStyles(style, "font-style: italic;"));
}
return document;
}
static void cleanup(Document d) { static void cleanup(Document d) {
// https://www.chromestatus.com/feature/5756335865987072 // https://www.chromestatus.com/feature/5756335865987072
// Some messages contain 100 thousands of Apple spaces // Some messages contain 100 thousands of Apple spaces

Loading…
Cancel
Save